Re: XForms: Xforms as a plugin

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 1 Apr 98 14:06:36 PST

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

> I'd like to use the xforms library for plug-ins to several 3D packages.
> The problem is that the 3D packages demand to be run most of the time
> which causes problems with Xevent handling. I can set up handlers
> within the 3D package to take care of the plugins Xevents, but I'm
> having trouble making my Xforms windows a child to the 3D packages. Is
> there a way to initialize the xforms library without creating the X
> windows equivalent of a whole new application?

What do you mean by "child to the 3D packages?" Do you mean an actual
child process or simply a chunk of code to handle user interaction?

You can turn the XForms programming model inside out by using
fl_check_forms() rather than fl_do_forms(). If fl_check_forms()
doesn't detect any work for it to do it will return immediately to the
caller without blocking. If you can fire off a fl_check_forms() with
some reasonable frequency, say once every 250 milliseconds or so, then
you should both be able to maintain reasonable interactivity and not
degrade the performance of your application significantly. If you do
this, you don't even need to worry about specifically responding to
XEvents in your main application.

If you want a more asynchronous type of handler, you'll probably have
to look into forking and execing off a new process that runs the
XForms user interface and communicates to the parent (or co-) process
via one of the interprocess communications mechanisms such as shared
memory, message queues, semaphores, or sockets.

Can you be more specific about the sort of interactions you desire?

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/