Disabling PushButtons?

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Disabling PushButtons?

Submitted by Anonymous on Tue, 12/26/2000 - 23:56. Developers
Help! Is their a way to disable a pushbutton other than using XtUnmanageChild()?

ICS_support

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.

Anonymous

nt=no text