Re: XForms: launching X applications

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 4 Sep 97 17:42:42 PDT

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

> I just want to include a button on one of my forms that runs an external X
> program. I have a callback function attached to this button that just
> forks a new process and runs the application in this child process.
> Unfortunately, the child process can't open the X display for some reason.
> If, I were to try to run xv for instance, I would get an error like "xv
> can't open display" or something.

The exact error message would be helpful. You might check to see if
the DISPLAY environment variable is passed correctly.

This worked perfectly for me in an admittedly quick test:

void launch_cb(FL_OBJECT *ob, long data)
{

if ( fork() == 0 )
execl( "/usr/X11R6.1/bin/xv", "xv", NULL );

}

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