[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1233.0. "multiple hierarchy in UIL HOW???" by SKYLRK::LOSCHEN () Fri Aug 04 1989 05:12

Suppose you have an application written using UIL that puts up a hierarchy
like this.      main_window
		  dialog_box,
	       	    push_button1
		    push_button2
		    list_box 
                      popup_menu
The application will need to display from 1 t n of these hierarchies,
with actions in any of them going to a common set of callbacks.

Is there a way to use 1 UIL template here for the hierarchy, but create 
multiple instances of it?  And do it dynamically?  Without global variables?  

Is it possible for the callbacks to pass back not only their own ID's, but also
that of their parents or the top level widget?  If not, is there a way to
directly find out the top level widget, given any of its children's
ID's?

Finally, has anybody used the X context manager?  Could the ID's of each of 
these hierarchies be stored in a structure, and saved in the "master" 
main_window, to avoid the heavy use of global variables?  If so, is there a 
downside to doing this.

I am sure most of this is doable - I just can seem to catch on how it
might be done.  I would appreciate any help you can give me.

Thanks,
Brent

T.RTitleUserPersonal
Name
DateLines
1233.1XtParent()TALLIS::ZANZERKIAFri Aug 04 1989 15:588
     
    	Use the XtParent(child) to find the parent widget id.
    	I have not use the X context manager, However i have done what
    	you suggest. One data structure to hold most widget id's,
    hierarchy. I did not had any problems with that..
    
    Robert

1233.2XtAppCreateShellLBDUCK::SCHOELLERWho's on first?Fri Aug 04 1989 18:2316
It is very possible.  You can choose to use multiple contexts as suggested in
.1 or not (it should make no difference).  The main thing that you want to do
is not put any children under the widget returned by XtInitialize and to not
realize it.

Instead, use XtAppCreateShell to create the applicationShellWidgetClass widget
for the toplevel of each heirarchy.  The you can use DwtFetchWidget to
bring in the heirarchy that goes under it.  If you want to keep an array
of widget ids for each heirarchy (a la decburger) then you must allocate
a new widget id array for each heirarchy.  The create routines would then
need to identify which tree they were in.  We do this by pointing to the
"active" heirarchy with a single global.  You can also look for the id of
the parent in the appropriate place in each of the arrays.

Dick