;+ ; ; @file_comments ; Find, from an Id of widget, the Id of the widget which is ; "the top-level base" (i.e., it has no parent) ; ; categories ; widget ; ; @param WIDGET_ID ; This argument should be the widget ID of the ; widget for which information is desired. ; ; @returns ; The Id of the widget which is "the top-level base" ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 22/9/1999 ; ; @version ; $Id$ ; ;- FUNCTION findtopid, widget_id ; compile_opt idl2, strictarrsubs ; id = long(WIDGET_ID) ; exist = widget_info(id, /managed) ; if exist EQ 0 then return, -1 topid = id topid2 = id while topid2 NE 0 do begin topid = topid2 topid2 = widget_info(topid2, /parent) endwhile return, long(topid) end