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 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.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
507.1 | if (!XtSensitive(w)) return; | DECWIN::KLEIN | Thu Mar 30 1989 19:36 | 22 | |
>> 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- |