Re: XForms: Xforms and the Load of file

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 5 Oct 99 19:29:07 PDT

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

> I work with the xforms to load a file in a browser,but when a select a line
> in that browser,it close the application,so can you help me?
>
> the description of load file in browser is:
> fl_load_browser(FL_OBJECT *ob,const char *filename)

Have you assigned a callback function to the browser object? If you
haven't then XForms will cause fl_do_forms() to exit, returning a
pointer to the object. If you have used `fdesign' to emit a main() to
your program, and have not changed the way fl_do_forms() is handled,
you'll have something like

int main(int argc, char *argv[])
{
FD_try *fd_try;

fl_initialize(&argc, argv, 0, 0, 0);
fd_try = create_form_try();

/* fill-in form initialization code */

/* show the first form */
fl_show_form(fd_try->try,FL_PLACE_CENTERFREE,FL_FULLBORDER,"try");
fl_do_forms();
return 0;
}

and if fl_do_forms() returns, then your program will exit in the
obvious manner.

You can code

...

while ( 1 )
fl_do_forms();

to prevent this.

This means, of course, that you must handle termination of the program
through some callback action.

For more detail, please refer to the manual.

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/