| 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 | 
I have a question about how to most effectively use UIL.  
I am creating a main window widget, then another window within it that 
I actually write graphics into.  The code segment below shows how I am 
doing this with two calls to DwtFetchWidgets.  I have also included 
the UIL segment.
This works perfectly well, but it doesn't strike me as very elegant.  
I feel like I am missing a point somewhere.  Shouldn't I be able to 
declare this somewhere as a heirarchy and with one call go off and 
create the whole thing?  This is a simple case, but obviously it 
generalizes very quickly into large hierarchies.  Is there a place 
within UIL where I indicate that one window is a child of another?
Thanks for any and all suggestions.
Ken B.
Here is the relevant C code:
	.
	.
	.
    DwtInitializeDRM();
    toplevel = XtInitialize(	"Yadman",
				"TopLevel",
				NULL,
				0,
				&argc,
				&argv );
    if ( DwtOpenHierarchy(	1,
				UID_database,
				NULL,
				&Hierarchy ) != DRMSuccess )
				error( "Can't open hierarchy!" );
    DwtRegisterDRMNames(    callback_namevec, callback_num );
    if ( DwtFetchWidget(	Hierarchy,
				"MainWindow",
				toplevel,
				&mainwidget,
				&dummy ) != DRMSuccess )
				error( "Can't fetch main window!" );
    if ( DwtFetchWidget(	Hierarchy,
				"WorkWindow",
				mainwidget,
				&workwidget,
				&dummy ) != DRMSuccess )
				error( "Can't fetch work window!" );
    XtManageChild ( workwidget);
    XtManageChild ( mainwidget);
    XtRealizeWidget( toplevel);
	.
	.
	.
And here is the UIL code:
	.
	.
	.
object
	MainWindow : exported main_window 
	    {
	     arguments {
		x = 100;
		y = 100;
		width = 400;
		height = 400;
	     };
	     callbacks {
		create = procedure WidgetIDproc( k_MainWindow );
	     };
	     controls {
		menu_bar   MenuBar;
	     };
	};
	
	WorkWindow : exported window
	    {
	     arguments {
		x = 100;
		y = 100;
		width = 400;
		height = 400;
	    };
	    callbacks {
		create = procedure WidgetIDproc (k_WorkWindow );
		expose = procedure MyExpoproc ( k_WorkWindow );
	    };
	};
	.
	.
	.
    
| T.R | Title | User | Personal Name | Date | Lines | 
|---|---|---|---|---|---|
| 444.1 | One fetch is better | TBD1::BURLEIGH | Dave, DECwindows Training | Tue Mar 21 1989 06:59 | 6 | 
|     In your uil module, include the work window in the CONTROLS
    list of the main-window widget. Then fetching the main window
    will get you the work window too.
    
    Dave
 | |||||
| 444.2 | Thanks | HGOVC::KENBERKUN | Klaatu Barato Nikto | Tue Mar 21 1989 20:14 | 4 | 
|     Thanks very much, I'll give that a go.
    
    Ken B.
 | |||||
| 444.3 | More detail please... | HGOVC::KENBERKUN | Klaatu Barato Nikto | Wed Mar 22 1989 06:09 | 18 | 
|     Well...
    
    I'm still missing something.  I added the following line in the
    controls section of MainWindow
    
    Window WorkWindow;
    
    Then I eleminated the second call to DwtFetchWidget.
    
    No good.  It still doesn't bring up the workwindow widget.  I tried
    all kinds of combinations of fetching and managing, etc.  I wasn't
    getting anywhere, so can someone please be kind enough to post an
    example.
          
    thanks in advance,
    
    Ken B.
 | |||||
| 444.4 | case_sensitive? | TBD1::BURLEIGH | Dave, DECwindows Training | Wed Mar 22 1989 06:37 | 6 | 
|     Well, if you included *exactly* "Window WorkWindow", and you're
    using the "case_sensitive" mode of UIL, you should use instead
    "window WorkWindow". Keywords must be lowercase.
    
    Dave
 | |||||
| 444.5 | the beginner's Bible | SMAUG::FLOWERS | IBM Interconnect Eng. 226-7716 | Wed Mar 22 1989 09:26 | 6 | 
| Can I suggest taking a look at the decburger example...on VMS it's in decw$examples:decburger.* It may look confusing at first, but it's really a great place to start when learning UIL. Dan | |||||
| 444.6 | argh... | HGOVC::KENBERKUN | Klaatu Barato Nikto | Thu Mar 23 1989 05:16 | 2 | 
| Still having problems, question continued in note 463. | |||||
| 444.7 | Try UIL Conference | FUEL::graham | if ya want home cookin, stay home | Thu Mar 23 1989 20:48 | 6 | 
| Ken, have you looked at the UIL conference on CLT? Kris.. | |||||
| 444.8 | Thanks | HGOVC::KENBERKUN | Klaatu Barato Nikto | Fri Mar 24 1989 05:39 | 8 | 
|     re .7
    
    Good Idea, Kris, I hadn't looked there.  I will.
    
    Thanks,
    
    Ken
 | |||||
| 444.9 | Take_focus to simple text widget | 57727::FARRELL | Money, there is no substitute! | Fri May 26 1989 10:10 | 9 | 
| How can I get a specific simple text widget to take_focus. i.e. Like the password widget on the login screen after you type a username. advaTHANKSnce, $$$$ ted $$$$ | |||||