Child widget group leader of its own TLB? [message #9405] |
Mon, 30 June 1997 00:00  |
nhbkmich
Messages: 8 Registered: January 1996
|
Junior Member |
|
|
Dear IDL experts,
is it possible (allowed) to make a child widget a group leader of its own
top level base?
For me (I'm running IDL 4.0.1 under HP-UX 10.20) this works fine, as long as
the child widget is the last one in the hierachy. But if it isn't...
Consider the following example:
PRO GroupTest1, Id = Id
Top = WIDGET_BASE(/ROW)
Text = WIDGET_TEXT(Top)
Exit = WIDGET_BUTTON(Top, VALUE = 'Dummy')
WIDGET_CONTROL, Top, GROUP_LEADER = Text, /REALIZE
Id = Text
END
The text widget is the one, whose id is passed outside and which is supposed
to act as group leader. Go ahead:
IDL> grouptest1, id = id
IDL> widget_control, id, /destroy
% X windows protocol error: (BadWindow (invalid Window parameter)).
Apparently, the window manager has something to complain about. Sometimes
- not reproducible for me - this even crashes IDL completely. I've fiddled
around with different ways to avoid this error. It disappears when updating
is switched off before destroying the text widget. But, according to the
manual, manipulating the update state has only effect on Motif based window
systems. So that solution would be rather unportable.
I ended up with a kind of group leader cascade:
PRO GroupTest1, Id = Id
Top = WIDGET_BASE(/ROW)
Text = WIDGET_TEXT(Top)
Exit = WIDGET_BUTTON(Top, GROUP_LEADER = Text, VALUE = 'Dummy')
WIDGET_CONTROL, Top, /REALIZE
WIDGET_CONTROL, Top, GROUP_LEADER = Exit
Id = Text
END
This method is meant to ensure, that there is no widget behind "Text" when
"Top" is destroyed. This appears to work, but is it reliable?
Is there a defined order of evaluation in such a cascade?
Any help appreciated
Michael
--
************************************************************ *****************
Michael Steffens Institut f. Meteorologie u. Klimatologie
Tel.: +49-511-7624413 Universitaet Hannover
email: Michael.Steffens@mbox.muk.uni-hannover.de Herrenhaeuser Str. 2
steffens@muk.uni-hannover.de D-30419 Hannover
PGP fingerprint = FA BE 6C 1C F6 C3 EC 33 DD 42 6B 7F DE CF 84 B8
|
|
|