[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

3256.0. "disable/enable items in pull-down menu" by TPOVC::JOHNNYHO () Fri Aug 24 1990 12:38

    In DECwrite, DECdecision or Paint, you must have noticed that there
    are some items in some pull-down memus are disable and its text color
    is much lighter than other enabled item. This happens when you're in
    some specific mode.
    
    I would like to implement this feature in my user interface but I can't
    find any example showing this feature. Could any tell me how to program
    it in XUI? Any example available?
    
    Johnny
T.RTitleUserPersonal
Name
DateLines
3256.1Set the sensitivity attribute of the push_buttonTOWNS::RUFFIEUXFri Aug 24 1990 12:5735
    
    If I am understanding you correctly, you would like to set the 
    sensitvity of a push_button in a pull-down menu. 
    
    step 1:  Be sure to do a create in your UIL on the push_button.
    	     Also, you can set the initial sensitivity here. ( By default
    	     it is True, meaning you CAN use it )
    
    object
      button_pb : push_button {
    	arguments {
    	   label_label = compound_string('Button');
    	   sensitive   = false; 
    	};
    	callbacks {
    	   create = procedure createCB(BUTTON_PB);
    	};
    };
    
    Step 2:  Now, in you C code ( or whatever language you use ) when
             you are ready to make the button accessible:
    
    Arg al[1];
    .
    .
    XtSetArg(al[0],DwtNsensitive,True);
    XtSetValues(widgets[BUTTON_PB],al,1);
    
             This will make the button sensitive.
    
    Hope this helps...
    
    Chris
    
    
3256.2BBOOP::SCAERFri Aug 24 1990 17:047
>    XtSetArg(al[0],DwtNsensitive,True);
>    XtSetValues(widgets[BUTTON_PB],al,1);

	Calling XtSetSensitive might be more efficient:

	XtSetSensitive(widgets[BUTTON_PB], True);
3256.3Thanks!TPOVC::JOHNNYHOMon Aug 27 1990 10:143
    Thank you! That's what I need!
    
    Johnny
3256.4CLTMAX::dickSchoeller - Failed XperimentMon Aug 27 1990 15:417
The other advantage of XtSetSensitive (over XtSetValues) is that it cascades
into children.  That way you can set a menu and its children insensitive with a
single call.  This can be especially important for affecting complex widgets
which are made up of multiple children (ie: list box).  In that case the
XtSetValues call may not affect the children resulting in unexpected behavior.

Dick