.arrow callActionProc ArmAndActivate()This sends a ClientMessage event to the widget. Most other widgets would ignore this event, so this call is sufficient. Some actions require event detail, though. For example, when a mouse button release occurs, the widget checks to see if the release occurred inside or outside the widget. If the event occured inside, then callbacks attached to the Activate() action are invoked; otherwise they are not. To handle this, an event of type ButtonPress, ButtonRelease, KeyPress, or KeyRelease can be prepared with some fields set. For example, a ButtonRelease occurring within the arrow can be sent by this call:
.arrow callActionProc Activate() -type ButtonPress -x 0 -y 0Some of the Text manipulation actions require a KeyPress event, such as self-insert(), which inserts the character pressed. The character is actually encoded as a keycode, which is a hardware-dependent code, too low-level for this binding. To prepare such an event, this toolkit uses keysyms, which are abstractions for each type of key symbol.
The alphanumerics have simple representations as themselves (a
, A
, 2
, and so on). Others have symbolic names (space
, Tab
, BackSpace
). These are derived from the include file <X11/keydefs.h> by removing the XK_ prefix.
This example inserts the three characters "A a" into a text widget:
.text callActionProc self-insert() -type KeyPress -keysym A .text callActionProc self-insert() -type KeyPress -key space .text callActionProc self-insert() -type KeyPress -key aThe set of actions requiring this level of X event preparation is not documented explicitly.