[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Listing all top-level widgets



Is anyone aware of any way to generate a list of all the currently realized
top-level widgets (or better still all the realized modal top-level widgets
but getting that once provided with a list of all tlb's is easy)?

The only ways I can think of are:
1)
for j =0l, largest_long do begin
    if (widget_info(j,/valid)) then begin
        if (widget_info(j, /parent) eq 0 and widget_info(j,/modal)) then$
            imodal = 1
       endif
   endif
endfor

Which would take forever to run

2) Require that any modal top-level base deposit it's ID in a common block
3) Dig out where the information is stored within xmanager (and hope that
there are no modal widgets that don't use xmanager

Or maybe there's a more elegant solution altogether to this problem, namely:
I have a menu that pops up when a file search fails, and it is possible that
the routine that called the file search was triggered from a modal menu, but
it's about half-a-dozen calls away so passing a group-leader ID down the
calling chain isn't really practical.

James
-- 
+------------------------+-------------------------------+---------+
| James Tappin           | School of Physics & Astronomy |  O__    |
| sjt@star.sr.bham.ac.uk | University of Birmingham      | --  \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722                  |         |
+--------------------------------------------------------+---------+