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

Last change on this file was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

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