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

Last change on this file since 254 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 783 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;-
25;
26FUNCTION findtopid,  WIDGET_ID
27;
28  compile_opt idl2, strictarrsubs
29;
30   id = long(WIDGET_ID)
31;    exist = widget_info(id, /managed)
32;    if exist EQ 0 then return,  -1
33   topid = id
34   topid2 = id
35   while topid2 NE 0 do begin
36      topid = topid2
37      topid2 = widget_info(topid2, /parent)
38   endwhile
39   return,  long(topid)
40end
Note: See TracBrowser for help on using the repository browser.