Re: XForms: pb with slider

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 21 Oct 99 08:08:07 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> With the former code (attach) i've lose the application trying to move
> the cursor of the slider with no error message. I've tried to fix it 1)-
> adding callback, 2)- debug code.
> [...]
> Why is closing my application trying to clic in slider
> [...]
> form2 =3D fl_bgn_form(FL_UP_BOX, 320,120);
> sld =3D fl_add_valslider(FL_HOR_SLIDER,40 ,70,120,30, "");
> fl_set_slider_bounds(sld,0, 100);
> count =3D fl_get_slider_value(sld);
> =20
> fl_end_form();
>
> fl_show_form(form, FL_PLACE_MOUSE,FL_FULLBORDER, "Bonjour le Monde !");
>
> fl_do_forms();
> }

The application exits because there is no callback assigned to your
Slider object. When an object without a callback is actuated by some
user action, a pointer to that object is returned by fl_do_forms() and
control is returned to the function which called fl_do_forms(). If
this function is constructed as above, this means that the calling
function and, thus, in this case, the program will terminate.

If you have objects which have no callbacks (this is common where
the user fills in some data and makes various settings, then hits an
"accept" button or the like) and you do not wish the program to
terminate when they are modified, then you should code

while ( fl_do_forms() )
;

or something similar. If you code in this manner, you must, of
course, provide some clean way of terminating the program -- perhaps
with a "Quit" button.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/