Re: wait for close down of a widget [message #6507] |
Wed, 10 July 1996 00:00 |
hahn
Messages: 108 Registered: November 1993
|
Senior Member |
|
|
Joost Sytsma <J.Sytsma@fys.ruu.nl> wrote:
[snip]
> On our Silicon Graphics this
> causes no problem: once you have changed the color table moving the mouse to
> the image display shows the image in the new colors. When working remotely on
> my PC, running XReflection to emulate an X terminal, I have to explicitly
> refresh the image display to see the new colors.
Maybe I misunderstood the original problem. I ran the following IDL code on a
workstation:
a = dist(200)
tvscl, a
xloadct
When I switch the lookup table in xloadct both the color bar in the xloadct
widget and window 0 are updated simultaneously. No need to move the
mouse into window 0.
I use HCL eXceed as X Server on my PC. I had such a problem you described
with HCL eXceed several versions ago. But this was fixed between eXceed
version 3.2 and 3.3.3. Now I have version 5.0.1 installed...
To have the lookup table updated instantly on the PC the X Server should
allocate a so called private color table.
Hope this helps
Norbert
|
|
|
Re: wait for close down of a widget [message #6509 is a reply to message #6507] |
Wed, 10 July 1996 00:00  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
On Tue, 9 Jul 1996, Joost Sytsma wrote:
> I have a question on how to wait for the close down of a specific widget.
> <snip>
> "COLOR": BEGIN
> XLOADCT ; start xloadct to laod new colors
> REPEAT J=1 UNTIL (XREGISTERED("xloadct") EQ =0)
> ; wait until xloadct is done
> WSET, xplane_wid & TV, xplane ; refresh display to get new colors
> END
> <snip>
> I can check that xloadct is indeed registered, but once the program is in the
> repeat loop, xloadct does not react on the CLOSE button, and the program
> remains in the repeat loop. How come and what is the solution to it?
I can show you how to get this to work, but I can only give a half-hearted
arm-waving explanation about what's going on.
It seems that when one does the type of thing you have done - launch a
non-modal widget (event handler et al) from within an event handler and
try to check on its status without exiting "your" event handler - one gets a
weird nested, recursive thing going inside IDL, and things start behaving
illogically. ("Your" event handler was originally called by XMANAGER,
and now it is indirectly calling XMANAGER itself by invoking the new
widget. XMANAGER uses WIDGET_EVENT(), which is where the mystery really
lies...)
Anyway.
The trick in your case is to call WIDGET_EVENT() yourself:
xloadct,group=event.top ;give your TLB as group leader
repeat
j=widget_event(/nowait) ;don't specify a widget ID here
until xregistered('xloadct') eq 0
This appears to "shake things up" (without hustling events), with a result
that xregistered() works as expected.
Peter Mason
|
|
|