[comp.windows.x] real time x, transparent windows

lteyssie@POLYSLO.CALPOLY.EDU (Luke Teyssier) (10/11/89)

Your responses to my previous inquiry about tiling window managers were
very helpful.  I am currently working with rtl from siemens and it 
is a good environment.

According to the X Toolkit intrinsics, page 66, XtAppAddTimeOut allows
a timeout procedure to be specified.  The manual shows that the timeout
procedure can be specified in terms of milliseconds. I am running X11
R3 on a sun 3/50 and a sun3/60, and I am trying to interface to a real time
program written in Ada that will be running on a machine connected to the 
sun.  My question is this: can I really get millisecond response time
granularity? Is that a gurantee of the maximum time to the timeout, or the 
minimum time to the timeout, or in some range?  Does this work even if
you are in a callback procedure, or only if you are in the XtMainLoop
sitting idle?

There was a discussion on Comp.windows.x for some time on how to make
transparent widows.  I missed part of the discussion.  What I would like
to do is have a window underneath another window and have both of them
visible in the opaque regions and yet be able to change the pattern on either
one, sort of like having two overhead transparancies stacked one on top of
the other.  Failing that, I would like to be able to construct a widget 
such that a predefined pattern would be displayed permanently in the 
background, such as a grid or a crosshairs with tick marks on it.  My idea
is that you would write on the foreground and then you could erase the
foreground picture and the background would still be intact.  It would have
to be able to deal with resize and expose events of course.

Thanks for your help.

Luke Teyssier (lteyssie@polyslo.calpoly.edu 129.65.17.1)

swick@ATHENA.MIT.EDU (Ralph R. Swick) (10/11/89)

> According to the X Toolkit intrinsics, page 66, XtAppAddTimeOut allows
> a timeout procedure to be specified.
...
> can I really get millisecond response time
> granularity?

Probably not.  It's a function of the underlying OS; the value is
passed directly to select().

> Is that a gurantee of the maximum time to the timeout, or the 
> minimum time to the timeout, or in some range?

Minimum, if anything; the timer may expire during dispatching of
some other event (timer, alternate input callback, or XEvent)
which can take arbitrarily long.

> Does this work even if
> you are in a callback procedure, or only if you are in the XtMainLoop
> sitting idle?

The most recent timer event to expire is processed by XtAppProcessEvent
or XtAppNextEvent; there is no preemption.

> What I would like
> to do is have a window underneath another window and have both of them
> visible in the opaque regions and yet be able to change the pattern on either
> one, sort of like having two overhead transparancies stacked one on top of
> the other.

Not supported by the core X11 protocol.

> Failing that, I would like to be able to construct a widget 
> such that a predefined pattern would be displayed permanently in the 
> background, such as a grid or a crosshairs with tick marks on it.

Pretty simple; create a Pixmap (be careful about depth), draw your
static graphics into it, then make it be the window background.  You'll
use up a lot of server resources if you make lots of these, but then
you'd probably expect that to be the case.