Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtSetSensit(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtGetValues(1)

XtIsSensitive(1)

XtSetValues(1)

 

Name

XtSetSensitive — set the sensitivity state of a widget. 

Synopsis

void XtSetSensitive(w, sensitive)

    Widget w;
    Boolean sensitive;

Arguments

wSpecifies the widget. 

sensitiveSpecifies a Boolean value that indicates whether the widget should receive keyboard, pointer, and focus events. 

Description

Many widgets have a mode in which they assume a different appearance (for example, grayed out or stippled), do not respond to user events, and become dormant. 

When dormant, a widget is insensitive.  This means that the Intrinsics do not dispatch any events to the widget with an event type of KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify, EnterNotify, LeaveNotify, FocusIn, or FocusOut. 

Widget sensitivity is controlled by the sensitive and ancestor_sensitive fields in the Core instance record.  The former is set with the XtNsensitive resource; the latter’s resource, XtNancestorSensitive, should only be queried.  A widget can be insensitive because its sensitive field is False or because one of its ancestors is insensitive (sensitive is always set to False if ancestor_sensitive is False).  A widget can, but does not need to, distinguish these two cases visually. 

XtSetSensitive first calls XtSetValues on the current widget with an argument list specifying the sensitive resource and the new value.  If sensitive is False and the widget is a subclass of Composite, XtSetSensitive recursively propagates the new value down the children tree by calling XtSetValues on each child to set ancestor_sensitive to False.  If sensitive is True and the widget is a subclass of Composite and the widget’s ancestor_sensitive field is True, then XtSetSensitive sets the ancestor_sensitive of each child to True and then recursively calls XtSetValues on each normal descendant that is now sensitive to set ancestor_sensitive to True. 

XtSetSensitive calls XtSetValues to change the sensitive and ancestor_sensitive fields in Core.  Therefore, when one of these changes, the widget’s set_values method should take whatever display actions are needed (for example, graying or stippling the widget). 

XtSetSensitive ensures that if a parent has either sensitive or ancestor_sensitive set to False, then all children have ancestor_sensitive set to False. 

Both sensitive and the ancestor_sensitive field are maintained as Booleans in the Core instance record, defined in <X11/CoreP.h>. 

See Also

XtGetValues(1), XtIsSensitive(1), XtSetValues(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026