source: trunk/WIDGET/findtopid.pro @ 2

Last change on this file since 2 was 2, checked in by opalod, 22 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME: findtopid
6;
7; PURPOSE: retrouve a partir d''un Id de widget l'Id du widget qui est
8; "the top-level base" (i.e., it has no parent)
9;
10; CATEGORY: aide pour les widgets
11;
12; CALLING SEQUENCE: res=findtopid(Widget_ID)
13;
14; INPUTS: Widget_ID: this argument should be the widget ID of the
15; widget for which information is desired.
16;
17; KEYWORD PARAMETERS:
18;
19; OUTPUTS: l'Id du widget qui est "the top-level base"
20;
21; COMMON BLOCKS:
22;
23; SIDE EFFECTS:
24;
25; RESTRICTIONS:
26;
27; EXAMPLE:
28;
29; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
30;                      22/9/1999
31;-
32;------------------------------------------------------------
33;------------------------------------------------------------
34;------------------------------------------------------------
35FUNCTION findtopid,  identite
36   id = long(identite)
37;    exist = widget_info(id, /managed)
38;    if exist EQ 0 then return,  -1
39   topid = id
40   topid2 = id
41   while topid2 NE 0 do begin
42      topid = topid2
43      topid2 = widget_info(topid2, /parent)
44   endwhile
45   return,  long(topid)
46end
Note: See TracBrowser for help on using the repository browser.