Murga-Projects Forums
More Windows problems - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: More Windows problems (/showthread.php?tid=297)


More Windows problems - mikshaw - 03-04-2008 04:46 AM

Testing the widgets demo some more in Windows, I found a few more things not working that had worked fine in Linux.

1) FL_PUSH and FL_RELEASE seem to be completely ignored.
Rather than using "if Fl:event() == fltk.FL_PUSH", what seems to work is "if Fl:event_buttons() > 0", and optionally "if Fl:buttons() > 0 and Fl:event_button() == 1" if you're testing specifically for a left click.

2) saveAsPng() seems to save a blank image, at least in the draw_freehand demo (using fl_line() to create the image data). I haven't tested it with other image data.

3) Certain XPM files do not properly display transparency, such as the one in image-xpm.lua (xpm_image.xpm). I'm thinking it may have to do with the characters used to represent colors, but that's just guessing. XPM files that were created or edited in mtpaint don't seem to have this trouble. Mtpaint uses alphanumeric characters only, and that's the only difference I can see. I'm going to edit xpm_image.xpm in mtpaint later to see if it fixes the problem.


RE: More Windows problems - JohnMurga - 03-04-2008 05:00 AM

mikshaw Wrote:
1) FL_PUSH and FL_RELEASE seem to be completely ignored.
Rather than using "if Fl:event() == fltk.FL_PUSH", what seems to work is "if Fl:event_buttons() > 0", and optionally "if Fl:buttons() > 0 and Fl:event_button() == 1" if you're testing specifically for a left click.

I found some of these, unfortunately it's an FLTK issue I can't really do much about :-(

mikshaw Wrote:
2) saveAsPng() seems to save a blank image, at least in the draw_freehand demo (using fl_line() to create the image data). I haven't tested it with other image data.

Have you tried displaying the image data to another control before saving it ? This should really always work.

It was tested under Windows ... Let me try it.

mikshaw Wrote:
3) Certain XPM files do not properly display transparency, such as the one in image-xpm.lua (xpm_image.xpm). I'm thinking it may have to do with the characters used to represent colors, but that's just guessing. XPM files that were created or edited in mtpaint don't seem to have this trouble. Mtpaint uses alphanumeric characters only, and that's the only difference I can see. I'm going to edit xpm_image.xpm in mtpaint later to see if it fixes the problem.

I think it will, I had a similar problem a while ago.

Cheers
John de Murga


RE: More Windows problems - mikshaw - 03-04-2008 07:15 AM

Thanks for the feedback. I'm going to try to test in Windows more regularly in the future, since it seems like there are more differences than I had expected.

Quote:
Have you tried displaying the image data to another control before saving it ? This should really always work.

I'm not sure what you're saying here, but here's what it's doing presently:
The scribble is made using a series of fl_line, then I used a mod of your readImage function (readImageTest.lua) to grab that area as rgb and save it. It is also supposed to apply that data to the original drawing area so it won't vanish on redraw, but that doesn't seem to work in Windows either (and often requires a forced redraw to display completely in Linux).


RE: More Windows problems - mikshaw - 03-04-2008 03:01 PM

The XPM issue seemed to have been due to the characters used in the file, but I'm not entirely convinced of that. When I opened the file in mtpaint and removed unused colors it showed transparency, but the color used for the transparency was the same as another color used for an actual color. I think it might have been a problem with a poorly constructed palette created by GIMP.

In any case, the next widgets package will have a fully working XPM file.


RE: More Windows problems - mikshaw - 03-05-2008 11:12 AM

oddly enough, FL_RELEASE seems to work in Windows in some situations. I didn't notice until I looked into the code that I had a test for FL_RELEASE in the browser on the left side of the widgets_demo package, and it seems to work as expected.

I added some code today for collapsing sections in the browser, so when I test that in Windows I'll know for sure.


RE: More Windows problems - JohnMurga - 03-05-2008 11:19 AM

Incidentally ...

I added a "murgaLua.getFltkEventText(event)" to return the text for the event, are you using this ?

I am going to try you draw demo to get to the bottom of the other problem tomorrow ... I am pretty sure it's got to do with inconsistent behavior of readImage which we can probably fix, but again I think it's FLTK.

Cheers
JohnM


RE: More Windows problems - mikshaw - 03-05-2008 11:26 AM

Quote:
I added a "murgaLua.getFltkEventText(event)" to return the text for the event, are you using this ?

No. Although it had already been added to the murgaLua Vim syntax file, I wasn't consciously aware of this function. Sometimes I shut off the "Oooo what's this?" response mechanism when I'm doing monotonous work.