Submitted by Anonymous on Tue, 12/26/2000 - 23:56. Developers
Help! Is their a way to disable a pushbutton other than using XtUnmanageChild()?
Fri, 06/29/2012 - 14:30
#1
Disabling PushButtons?
XtUnmanageChild() makes the widget actually disappear from the screen. This isn`t the effect that you want when you need to show, for example, that a menu choice is not currently valid or sensible. It makes more sense to show the value and indicate visually that it is inappropriate and that the button will not respond.
Fortunately, the widget does this, using an Xt mechanism called "sensitivity". To change the value, use XtSetSensitive() (see http//www.motifzone.com/resources/man/XtSetSensitive.html for details). This call flips a switch in the widget`s core field; when it is redisplayed, it redraws using appropriate visuals (for push-buttons, a slight greying-out), and Xt automatically blocks out input.
Use XtSetSensitive() rather than directly setting the XtNsensitive resource.
nt=no text