News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
More Windows problems
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
Rolleyes  More Windows problems

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.

03-04-2008 04:46 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: More Windows problems

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

03-04-2008 05:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #3
RE: More Windows problems

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).

03-04-2008 07:15 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #4
RE: More Windows problems

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.

03-04-2008 03:01 PM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #5
RE: More Windows problems

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.

03-05-2008 11:12 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #6
RE: More Windows problems

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

03-05-2008 11:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #7
RE: More Windows problems

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.

03-05-2008 11:26 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: