Re: X widget

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 14 Jan 97 16:08:49 PST

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

> Well, There are a lot of commercial widgets out there (We won a couple)
> which provide tons of functionality that I don't care to re-write (look
> at those from xrt and/or int). These are NOT complete applications. I'd
> like a way of building an xforms app, which uses these external widgets
> (if possible). If not possible, I just need to know.

As I mentioned, I think it's been tried with Bloatif but I don't know
if it was successful. Personally, I've never had a requirement that
XForms (along with other graphics toolkits such as OpenGL/Mesa or PEX)
didn't allow me to address but perhaps my requirements (visualization
and image processing/analysis) are more mundane than most. I've done
a fair amount of X programming in Xt, Xaw, and Xm and will now only
touch a Widget if absolutely forced into it after dealing with XForms.
Your mileage may vary.

> Is it possible to build a small app w/ the widget, and a small app w/
> xforms, and make the two communicate behind the scenes? This would get me
> there, without really having a single program, but the user would not
> have to know the difference.

That you could do. Communicate by pipes or by shared memory,
semaphores, and/or message queues. This raises numerous
synchronization issues that may not make it worth while. The visual
result might also not be what you're looking for -- the Widget based
part of the application is probably going to look a lot different than
the XForms application and buttons and knobs will probably act
slightly differently, raising a serious user interface problem.

If you're hell bent upon embarking on this, look at the section
entitled "Low-level Management of the Event Queue" in the O'Reilly Xt
Programming Manual (it's in Chapter 9). Fetch the event with
XtAppNextEvent(), decide whether an event belongs to your Widgets or
to XForms, and dispatch appropriately. It may even work. :-)

spl