source: trunk/SRC/ToBeReviewed/WIDGET/findtopid.pro @ 219

Last change on this file since 219 was 157, checked in by navarro, 18 years ago

header improvements + xxx doc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments
7; Find, from an Id of widget, the Id of the widget which is
8; "the top-level base" (i.e., it has no parent)
9;
10; categories
11; widget
12;
13; @param WIDGET_ID
14; This argument should be the widget ID of the
15; widget for which information is desired.
16;
17; @returns
18; The Id of the widget which is "the top-level base"
19;
20; @history
21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
22;                      22/9/1999
23;
24; @version
25; $Id$
26;
27;-
28;------------------------------------------------------------
29;------------------------------------------------------------
30;------------------------------------------------------------
31FUNCTION findtopid,  WIDGET_ID
32;
33  compile_opt idl2, strictarrsubs
34;
35   id = long(WIDGET_ID)
36;    exist = widget_info(id, /managed)
37;    if exist EQ 0 then return,  -1
38   topid = id
39   topid2 = id
40   while topid2 NE 0 do begin
41      topid = topid2
42      topid2 = widget_info(topid2, /parent)
43   endwhile
44   return,  long(topid)
45end
Note: See TracBrowser for help on using the repository browser.