Re: Child widget group leader of its own TLB? [message #9459 is a reply to message #9405] |
Thu, 03 July 1997 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
nhbkmich@rrzn-user.uni-hannover.de wrote:
>
> 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)).
>
> 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?
>
Michael -
I think you may be confused about the concept of GROUP_LEADER and
it's effect on widget destruction. When you create a widget heirarchy,
any and all widgets that are "below" the TLB will be destroyed
automatically when you destroy the TLB. By "below" I mean that you can
trace back from a widget up through the heirarchy and get to the
TLB. So there is no need for a cascade as you mention above.
The GROUP_LEADER keyword is intended for situations where you have
one widget program up and running, and then you with to call another
widget (a program or a modal popup) from within that first program.
In the second program you specify the TLB of the first widget as the
GROUP_LEADER. When you do this, the second widget will be destroyed
if the first is destroyed. You can have a whole series of programs
up, and have them all destroyed at once. This is also useful when
a program has several (or many!) widgets that all must
go when the parent widget is destroyed.
Hope this helps.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
"I have this theory that if we're told we're bad,
then that's the only idea we'll ever have.
But maybe if we are surrounded in beauty,
someday we will become what we see." - Jewel Kilcher
|
|
|