[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

507.0. "Push Button Widget Question" by RABBET::FARRELL (Money, there is no substitute!) Thu Mar 30 1989 12:35

I have a Simple Text Widget for user entry and a push button (OK) widget.

This is a typical situation.  The push button widget initially has its 
sensitivity turned off.  If any text is added into the Simple Text Widget,
the sensitivity of the push button widget is turned on.

My problem is this : I have the default widget set to the push button widget
                     so that if the user presses return on the Simple Text 
		     Widget line, the push button widget will be selected.

		     Well, this happens regardless of the sensitivity of the
		     push button widget.  (i.e. The push button widget can
		     have sensitive=false and a return will still activate it.)

	Is this normal, and how can I stop this from being selected when it's
	sensitivity is off.

		$$$$ ted $$$$

T.RTitleUserPersonal
Name
DateLines
507.1if (!XtSensitive(w)) return;DECWIN::KLEINThu Mar 30 1989 19:3622
>>	Is this normal, and how can I stop this from being selected when it's
>>	sensitivity is off.

Yes, I believe it is "normal"  You can work around the "problem" in at least
two ways.

(1) In the pushbutton's activate callback, add the following first line.
The variable "w" is the first parameter passed to the callback
routine - namely, the pushbutton widget ID.

	if (!XtSensitive(w)) return;

or, (2) When the pushbutton is set insensitive, also change the
dialog box's default button to be null (0).  When making the
button sensitive again, make it the default button again.  This
has the secondary effect of un-double-outlining the button when
it is insensitive, which may or may not be desirable.

I suggest approach (1) for performance reasons.

-steve-