Re: finding the top-level widget in a hierarchy [message #41019] |
Thu, 16 September 2004 12:00 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Benjamin Hornberger writes:
> does anyone have a function to find the corresponding top-level base for
> a given widget ID? Or did I miss something in the documentation of
> widget_info?
>
> I know that I can do a recursive call of widget_info(ID, /parent), but I
> thought somebody might have something readily available...
Here you go, a two-liner:
parent = widgetID
WHILE Widget_Info(parent, /Parent) NE 0 DO $
parent = Widget_Info(parent, /Parent)
Cheers,
David
-------
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
|
|
|