[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

444.0. "UIL Question" by HGOVC::KENBERKUN (Klaatu Barato Nikto) Tue Mar 21 1989 07:47

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.RTitleUserPersonal
Name
DateLines
444.1One fetch is betterTBD1::BURLEIGHDave, DECwindows TrainingTue Mar 21 1989 09:596
    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.2ThanksHGOVC::KENBERKUNKlaatu Barato NiktoTue Mar 21 1989 23:144
    Thanks very much, I'll give that a go.
    
    Ken B.

444.3More detail please...HGOVC::KENBERKUNKlaatu Barato NiktoWed Mar 22 1989 09:0918
    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.4case_sensitive?TBD1::BURLEIGHDave, DECwindows TrainingWed Mar 22 1989 09:376
    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.5the beginner's BibleSMAUG::FLOWERSIBM Interconnect Eng. 226-7716Wed Mar 22 1989 12:266
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.6argh...HGOVC::KENBERKUNKlaatu Barato NiktoThu Mar 23 1989 08:162
    Still having problems, question continued in note 463.

444.7Try UIL ConferenceFUEL::grahamif ya want home cookin, stay homeThu Mar 23 1989 23:486
Ken,

have you looked at the UIL conference on CLT?

Kris..

444.8ThanksHGOVC::KENBERKUNKlaatu Barato NiktoFri Mar 24 1989 08:398
    re .7
    
    Good Idea, Kris, I hadn't looked there.  I will.
    
    Thanks,
    
    Ken

444.9Take_focus to simple text widget57727::FARRELLMoney, there is no substitute!Fri May 26 1989 14:109
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 $$$$