[XForms] Lightbutton bug - Button causes app to crash.

Dennis K dennisk at netspace.net.au
Sun Apr 12 14:07:22 CEST 2009

To subscribers of the xforms list

Makes perfect sense.  I occured to me that the program was exiting
normally, I was just under the incorrect impression that it shoudln't have.

Thank's a million, and have a great Easter!  It's just that I've never
come across this before and coincidently came accross it when upgrading
from v0.89 to v1.0.91.

It's a great toolkit with a really easy to use GUI builder which lends
itself perfectly to those who want to write lightweight graphical
programs with ease.


Jens Thoms Toerring wrote:
> Hi Dennis,
> On Sat, Apr 11, 2009 at 06:49:43PM +0000, Dennis K wrote:
>>the diffence between whether those buttons cause the app to crash, is
>>wether something has been entered in the 'callback' secton of the
>>attributes form.  No callback = program exit.  Callback = runs fine.
> I don't think it's a bug what you are seeing here. In the
> example program you have more or less this:
>     fl_do_forms( );
>     return 0;             /* end of program */
> Now, fl_do_forms() isn't just an infinite loop. It returns
> the address of the object when interaction with that object
> happened - unless a callback function is installed for the
> object. And I think that's what happens in your case: when
> there's no callback for the button the fl_do_forms() func-
> tion returns the address of the button's object and then the
> program simply ends. If you install a callback for the button
> fl_do_forms() does not return, so the program continues to
> run. So if you don't use callbacks you should use something
> like this
>     while ( fl_do_form() != quit_button )
>         /* empty ; */
>     return 0;
> in order to avoid ending the program until some "Quit"
> button (object 'quit_button') has been clicked on. The
> fdesign program can't do that for you since it simply
> isn't clever enough to figure out which object might be
> the "Quit" button (or if there's one at all or more than
> one etc.), so it just puts in the call to fl_do_forms()
> and relies on you to fill in the rest.
> Does that make sense to you?
>                         Best regards, Jens


I am not an atomic playboy.
To unsubscribe, send any message to
xforms-leave at bob.usuhs.mil or see: 
List Archive: http://bob.usuhs.mil/pipermail/xforms and
XForms Home: http://savannah.nongnu.org/projects/xforms

More information about the Xforms mailing list