1
<chapter id='Translation_Management'>
2
<title>Translation Management</title>
4
Except under unusual circumstances,
5
widgets do not hardwire the mapping of user events into widget behavior
6
by using the event manager.
7
Instead, they provide a default mapping of events into behavior
12
The translation manager provides an interface to specify and manage the
13
mapping of X event sequences into widget-supplied functionality,
14
for example, calling procedure <emphasis remap='I'>Abc</emphasis> when the <emphasis remap='I'>y</emphasis> key
19
The translation manager uses two kinds of tables to perform translations:
21
<itemizedlist spacing='compact'>
24
The action tables, which are in the widget class structure,
25
specify the mapping of externally available procedure name strings
26
to the corresponding procedure implemented by the widget class.
31
A translation table, which is in the widget class structure,
32
specifies the mapping of event sequences to procedure name strings.
37
You can override the translation table in the class structure
38
for a specific widget instance by supplying a different translation table
39
for the widget instance. The resources
40
XtNtranslations and XtNbaseTranslations are used to modify the class
41
default translation table; see <xref linkend='Translation_Table_Management' />.
43
<sect1 id="Action_Tables">
44
<title>Action Tables</title>
46
All widget class records contain an action table,
48
<function>XtActionsRec</function>
51
an application can register its own action tables with the translation manager
52
so that the translation tables it provides to widget instances can access
53
application functionality directly.
54
The translation action procedure pointer is of type
55
<xref linkend='XtActionProc' xrefstyle='select: title'/>.
58
<funcsynopsis id='XtActionProc'>
60
<funcdef>typedef void <function>(*XtActionProc)</function></funcdef>
61
<paramdef>Widget <parameter>w</parameter></paramdef>
62
<paramdef>XEvent *<parameter>event</parameter></paramdef>
63
<paramdef>String *<parameter>params</parameter></paramdef>
64
<paramdef>Cardinal *<parameter>num_params</parameter></paramdef>
71
<emphasis remap='I'>w</emphasis>
75
Specifies the widget that caused the action to be called.
81
<emphasis remap='I'>event</emphasis>
85
Specifies the event that caused the action to be called.
86
If the action is called after a sequence of events,
87
then the last event in the sequence is used.
93
<emphasis remap='I'>params</emphasis>
97
Specifies a pointer to the list of strings that were specified
98
in the translation table as arguments to the action, or NULL.
104
<emphasis remap='I'>num_params</emphasis>
108
Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
115
typedef struct _XtActionsRec {
118
} XtActionsRec, *XtActionList;
121
The <emphasis remap='I'>string</emphasis> field is the name used in translation tables to access
123
The <emphasis remap='I'>proc</emphasis> field is a pointer to a procedure that implements
128
When the action list is specified as the
129
<function>CoreClassPart</function>
130
<emphasis remap='I'>actions</emphasis> field, the string pointed to by <emphasis remap='I'>string</emphasis> must be
131
permanently allocated prior to or during the execution of the class
132
initialization procedure and must not be subsequently deallocated.
136
Action procedures should not assume that the widget in which they
137
are invoked is realized; an accelerator specification can cause
138
an action procedure to be called for a widget that does not yet
139
have a window. Widget writers should also note which of a widget's
140
callback lists are invoked from action procedures and warn clients
141
not to assume the widget is realized in those callbacks.
145
For example, a Pushbutton widget has procedures to take the following actions:
147
<itemizedlist spacing='compact'>
150
Set the button to indicate it is activated.
155
Unset the button back to its normal mode.
160
Highlight the button borders.
165
Unhighlight the button borders.
170
Notify any callbacks that the button has been activated.
175
The action table for the Pushbutton widget class makes these functions
176
available to translation tables written for Pushbutton or any subclass.
177
The string entry is the name used in translation tables.
178
The procedure entry (usually spelled identically to the string)
179
is the name of the C procedure that implements that function:
182
XtActionsRec actionTable[] = {
185
{"Highlight", Highlight},
186
{"Unhighlight", Unhighlight}
191
The Intrinsics reserve all action names and parameters starting with
192
the characters ``Xt'' for future standard enhancements. Users,
193
applications, and widgets should not declare action names or pass
194
parameters starting with these characters except to invoke specified
195
built-in Intrinsics functions.
197
<sect2 id="Action_Table_Registration">
198
<title>Action Table Registration</title>
200
The <emphasis remap='I'>actions</emphasis> and <emphasis remap='I'>num_actions</emphasis> fields of
201
<function>CoreClassPart</function>
202
specify the actions implemented by a widget class. These are
203
automatically registered with the Intrinsics when the class is initialized
204
and must be allocated in writable storage prior to Core class_part
205
initialization, and never deallocated. To save memory and optimize
206
access, the Intrinsics may overwrite the storage in order to compile the
207
list into an internal representation.
211
To declare an action table within an application
212
and register it with the translation manager, use
213
<xref linkend='XtAppAddActions' xrefstyle='select: title'/>.
216
<funcsynopsis id='XtAppAddActions'>
218
<funcdef>void <function>XtAppAddActions</function></funcdef>
219
<paramdef>XtAppContext <parameter>app_context</parameter></paramdef>
220
<paramdef>XtActionList <parameter>actions</parameter></paramdef>
221
<paramdef>Cardinal <parameter>num_actions</parameter></paramdef>
228
<emphasis remap='I'>app_context</emphasis>
232
Specifies the application context.
238
<emphasis remap='I'>actions</emphasis>
242
Specifies the action table to register.
248
<emphasis remap='I'>num_actions</emphasis>
252
Specifies the number of entries in this action table.
259
If more than one action is registered with the same name,
260
the most recently registered action is used.
261
If duplicate actions exist in an action table,
263
The Intrinsics register an action table containing
264
<xref linkend='XtMenuPopup' xrefstyle='select: title'/>
266
<xref linkend='XtMenuPopdown' xrefstyle='select: title'/>
268
<xref linkend='XtCreateApplicationContext' xrefstyle='select: title'/>.
272
<sect2 id="Action_Names_to_Procedure_Translations">
273
<title>Action Names to Procedure Translations</title>
275
The translation manager uses a simple algorithm to resolve the name of
276
a procedure specified in a translation table into the
277
actual procedure specified
280
is realized, the translation manager
281
performs a search for the name in the following tables, in order:
283
<itemizedlist spacing='compact'>
286
The widget's class and all superclass action tables, in subclass-to-superclass
292
The parent's class and all superclass action tables, in subclass-to-superclass
293
order, then on up the ancestor tree.
298
The action tables registered with
299
<xref linkend='XtAppAddActions' xrefstyle='select: title'/>
301
<xref linkend='XtAddActions' xrefstyle='select: title'/>
302
from the most recently added table to the oldest table.
307
As soon as it finds a name,
308
the translation manager stops the search.
309
If it cannot find a name,
310
the translation manager generates a warning message.
314
<sect2 id="Action_Hook_Registration">
315
<title>Action Hook Registration</title>
317
An application can specify a procedure that will be called just before
318
every action routine is dispatched by the translation manager. To do
319
so, the application supplies a procedure pointer of type
320
<xref linkend='XtActionHookProc' xrefstyle='select: title'/>.
323
<funcsynopsis id='XtActionHookProc'>
325
<funcdef>typedef void <function>(*XtActionHookProc)</function></funcdef>
326
<paramdef>Widget <parameter>w</parameter></paramdef>
327
<paramdef>XtPointer <parameter>client_data</parameter></paramdef>
328
<paramdef>String <parameter>action_name</parameter></paramdef>
329
<paramdef>XEvent* <parameter>event</parameter></paramdef>
330
<paramdef>String* <parameter>params</parameter></paramdef>
331
<paramdef>Cardinal* <parameter>num_params</parameter></paramdef>
340
<emphasis remap='I'>w</emphasis>
344
Specifies the widget whose action is about to be dispatched.
350
<emphasis remap='I'>client_data</emphasis>
354
Specifies the application-specific closure that was passed to
355
<function>XtAppAddActionHook.</function>
361
<emphasis remap='I'>action_name</emphasis>
365
Specifies the name of the action to be dispatched.
371
<emphasis remap='I'>event</emphasis>
375
Specifies the event argument that will be passed to the action routine.
381
<emphasis remap='I'>params</emphasis>
385
Specifies the action parameters that will be passed to the action routine.
391
<emphasis remap='I'>num_params</emphasis>
395
Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
402
Action hooks should not modify any of the data pointed to by the
403
arguments other than the <emphasis remap='I'>client_data</emphasis> argument.
407
To add an action hook, use
408
<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>.
411
<funcsynopsis id='XtAppAddActionHook'>
413
<funcdef>XtActionHookId <function>XtAppAddActionHook</function></funcdef>
414
<paramdef>XtAppContext <parameter>app</parameter></paramdef>
415
<paramdef>XtActionHookProc <parameter>proc</parameter></paramdef>
416
<paramdef>XtPointer <parameter>client_data</parameter></paramdef>
423
<emphasis remap='I'>app</emphasis>
427
Specifies the application context.
433
<emphasis remap='I'>proc</emphasis>
437
Specifies the action hook procedure.
443
<emphasis remap='I'>client_data</emphasis>
447
Specifies application-specific data to be passed to the action hook.
454
<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>
455
adds the specified procedure to the front of a list
456
maintained in the application context. In the future, when an action
457
routine is about to be invoked for any widget in this application
458
context, either through the translation manager or via
459
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>,
460
the action hook procedures will be called in reverse
461
order of registration just prior to invoking the action routine.
465
Action hook procedures are removed automatically and the
466
<function>XtActionHookId is</function>
467
destroyed when the application context in which
468
they were added is destroyed.
472
To remove an action hook procedure without destroying the application
474
<xref linkend='XtRemoveActionHook' xrefstyle='select: title'/>.
477
<funcsynopsis id='XtRemoveActionHook'>
479
<funcdef>void <function>XtRemoveActionHook</function></funcdef>
480
<paramdef>XtActionHookId <parameter>id</parameter></paramdef>
487
<emphasis remap='I'>id</emphasis>
491
Specifies the action hook id returned by
492
<xref linkend='XtAppAddActionHook' xrefstyle='select: title'/>.
499
<xref linkend='XtRemoveActionHook' xrefstyle='select: title'/>
500
removes the specified action hook procedure from
501
the list in which it was registered.
506
<sect1 id="Translation_Tables">
507
<title>Translation Tables</title>
509
All widget instance records contain a translation table,
510
which is a resource with a default value specified elsewhere in the
512
A translation table specifies what action procedures are invoked for
513
an event or a sequence of events.
515
is a string containing a list of translations from an event sequence
516
into one or more action procedure calls.
517
The translations are separated from one another by newline characters
519
The complete syntax of translation tables is specified in Appendix B.
523
As an example, the default behavior of Pushbutton is
525
<itemizedlist spacing='compact'>
528
Highlight on enter window.
533
Unhighlight on exit window.
538
Invert on left button down.
543
Call callbacks and reinvert on left button up.
548
The following illustrates Pushbutton's default translation table:
551
static String defaultTranslations =
552
"<EnterWindow>: Highlight()\\n\\
553
<LeaveWindow>: Unhighlight()\\n\\
554
<Btn1Down>: Set()\\n\\
555
<Btn1Up>: Notify() Unset()";
558
The <emphasis remap='I'>tm_table</emphasis> field of the
559
<function>CoreClassPart</function>
560
should be filled in at class initialization time with
561
the string containing the class's default translations.
562
If a class wants to inherit its superclass's translations,
563
it can store the special value
564
<function>XtInheritTranslations</function>
565
into <emphasis remap='I'>tm_table</emphasis>.
566
In Core's class part initialization procedure,
567
the Intrinsics compile this translation table into an efficient internal form.
568
Then, at widget creation time,
569
this default translation table is
570
combined with the XtNtranslations
571
and XtNbaseTranslations resources; see
572
<xref linkend='Translation_Table_Management' />.
576
The resource conversion mechanism automatically compiles
577
string translation tables that are specified in the resource database.
578
If a client uses translation tables that are not retrieved via a
580
it must compile them itself using
581
<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>.
585
The Intrinsics use the compiled form of the translation table to register the
586
necessary events with the event manager.
587
Widgets need do nothing other than specify the action and translation tables
588
for events to be processed by the translation manager.
590
<sect2 id="Event_Sequences">
591
<title>Event Sequences</title>
593
An event sequence is a comma-separated list of X event descriptions
594
that describes a specific sequence of X events to map to a set of
596
Each X event description consists of three parts:
597
The X event type, a prefix consisting of the X modifier bits, and
598
an event-specific suffix.
602
Various abbreviations are supported to make translation tables easier
603
to read. The events must match incoming events in left-to-right order
604
to trigger the action sequence.
608
<sect2 id="Action_Sequences">
609
<title>Action Sequences</title>
611
Action sequences specify what program or widget actions to take in response to
612
incoming X events. An action sequence consists of space-separated
613
action procedure call specifications.
614
Each action procedure call consists of the name of an action procedure and a
615
parenthesized list of zero or more comma-separated
616
string parameters to pass to that procedure.
617
The actions are invoked in left-to-right order as specified in the
622
<sect2 id="Multi_Click_Time">
623
<title>Multi-Click Time</title>
625
Translation table entries may specify actions that are taken when two
626
or more identical events occur consecutively within a short time
627
interval, called the multi-click time. The multi-click time value may
628
be specified as an application resource with name ``multiClickTime'' and
629
class ``MultiClickTime'' and may also be modified dynamically by the
630
application. The multi-click time is unique for each Display value and
631
is retrieved from the resource database by
632
<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>.
633
If no value is specified, the initial value is 200 milliseconds.
637
To set the multi-click time dynamically, use
638
<xref linkend='XtSetMultiClickTime' xrefstyle='select: title'/>.
641
<funcsynopsis id='XtSetMultiClickTime'>
643
<funcdef>void <function>XtSetMultiClickTime</function></funcdef>
644
<paramdef>Display *<parameter>display</parameter></paramdef>
645
<paramdef>int <parameter>time</parameter></paramdef>
652
<emphasis remap='I'>display</emphasis>
656
Specifies the display connection.
662
<emphasis remap='I'>time</emphasis>
666
Specifies the multi-click time in milliseconds.
673
<xref linkend='XtSetMultiClickTime' xrefstyle='select: title'/>
674
sets the time interval used by the translation
675
manager to determine when multiple events are interpreted as a
676
repeated event. When a repeat count is specified in a translation
677
entry, the interval between the timestamps in each pair of repeated
678
events (e.g., between two
679
<function>ButtonPress</function>
680
events) must be less than the
681
multi-click time in order for the translation actions to be taken.
685
To read the multi-click time, use
686
<xref linkend='XtGetMultiClickTime' xrefstyle='select: title'/>.
689
<funcsynopsis id='XtGetMultiClickTime'>
691
<funcdef>int <function>XtGetMultiClickTime</function></funcdef>
692
<paramdef>Display *<parameter>display</parameter></paramdef>
699
<emphasis remap='I'>display</emphasis>
703
Specifies the display connection.
710
<xref linkend='XtGetMultiClickTime' xrefstyle='select: title'/>
711
returns the time in milliseconds that the
712
translation manager uses to determine if multiple events are to be
713
interpreted as a repeated event for purposes of matching a translation
714
entry containing a repeat count.
719
<sect1 id="Translation_Table_Management">
720
<title>Translation Table Management</title>
722
Sometimes an application needs to merge
723
its own translations with a widget's translations.
724
For example, a window manager provides functions to move a window.
725
The window manager wishes to bind this operation to a specific
726
pointer button in the title bar without the possibility of user
727
override and bind it to other buttons that may be overridden by the user.
732
the window manager should first create the title bar
733
and then should merge the two translation tables into
734
the title bar's translations.
735
One translation table contains the translations that the window manager
736
wants only if the user has not specified a translation for a particular event
737
or event sequence (i.e., those that may be overridden).
738
The other translation table contains the translations that the
739
window manager wants regardless of what the user has specified.
743
Three Intrinsics functions support this merging:
749
<emphasis remap='I'>XtParseTranslationTable</emphasis>
752
<para>Compiles a translation table.</para>
757
<emphasis remap='I'>XtAugmentTranslations</emphasis>
760
<para>Merges a compiled translation table into a widget's
761
compiled translation table, ignoring any new translations that
762
conflict with existing translations.
768
<emphasis remap='I'>XtOverrideTranslations</emphasis>
771
<para>Merges a compiled translation table into a widget's
772
compiled translation table, replacing any existing translations that
773
conflict with new translations.
780
To compile a translation table, use
781
<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>.
784
<funcsynopsis id='XtParseTranslationTable'>
786
<funcdef>XtTranslations <function>XtParseTranslationTable</function></funcdef>
787
<paramdef>String <parameter>table</parameter></paramdef>
794
<emphasis remap='I'>table</emphasis>
798
Specifies the translation table to compile.
806
<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>
807
function compiles the translation table, provided in the format given
808
in Appendix B, into an opaque internal representation
810
<function>XtTranslations</function>.
811
Note that if an empty translation table is required for any purpose,
812
one can be obtained by calling
813
<xref linkend='XtParseTranslationTable' xrefstyle='select: title'/>
814
and passing an empty string.
818
To merge additional translations into an existing translation table, use
819
<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>.
822
<funcsynopsis id='XtAugmentTranslations'>
824
<funcdef>void <function>XtAugmentTranslations</function></funcdef>
825
<paramdef>Widget <parameter>w</parameter></paramdef>
826
<paramdef>XtTranslations <parameter>translations</parameter></paramdef>
833
<emphasis remap='I'>w</emphasis>
837
Specifies the widget into which the new translations are to be merged. Must be of class Core or any subclass thereof.
843
<emphasis remap='I'>translations</emphasis>
847
Specifies the compiled translation table to merge in.
855
<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>
856
function merges the new translations into the existing widget
857
translations, ignoring any
858
<function>#replace</function>,
859
<function>#augment</function>,
861
<function>#override</function>
862
directive that may have been specified
863
in the translation string. The translation table specified by
864
<emphasis remap='I'>translations</emphasis> is not altered by this process.
865
<xref linkend='XtAugmentTranslations' xrefstyle='select: title'/>
866
logically appends the string representation of the new translations to
867
the string representation of the widget's current translations and reparses
868
the result with no warning messages about duplicate left-hand sides, then
869
stores the result back into the widget instance; i.e.,
870
if the new translations contain an event or event sequence that
871
already exists in the widget's translations,
872
the new translation is ignored.
876
To overwrite existing translations with new translations, use
877
<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>.
880
<funcsynopsis id='XtOverrideTranslations'>
882
<funcdef>void <function>XtOverrideTranslations</function></funcdef>
883
<paramdef>Widget <parameter>w</parameter></paramdef>
884
<paramdef>XtTranslations <parameter>translations</parameter></paramdef>
891
<emphasis remap='I'>w</emphasis>
895
Specifies the widget into which the new translations are to be merged. Must be of class Core or any subclass thereof.
901
<emphasis remap='I'>translations</emphasis>
905
Specifies the compiled translation table to merge in.
913
<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>
914
function merges the new translations into the existing widget
915
translations, ignoring any
916
<function>#replace</function>,
917
<function>#augment</function>,
919
<function>#override</function>
920
directive that may have been
921
specified in the translation string. The translation table
922
specified by <emphasis remap='I'>translations</emphasis> is not altered by this process.
923
<xref linkend='XtOverrideTranslations' xrefstyle='select: title'/>
924
logically appends the string representation of the widget's current
925
translations to the string representation of the new translations and
926
reparses the result with no warning messages about duplicate left-hand
927
sides, then stores the result back into the widget instance; i.e.,
928
if the new translations contain an event or event sequence that
929
already exists in the widget's translations,
930
the new translation overrides the widget's translation.
934
To replace a widget's translations completely, use
935
<xref linkend='XtSetValues' xrefstyle='select: title'/>
936
on the XtNtranslations resource and specify a compiled translation table
941
To make it possible for users to easily modify translation tables in their
943
the string-to-translation-table resource type converter
944
allows the string to specify whether the table should replace,
945
augment, or override any
946
existing translation table in the widget.
948
a pound sign (#) is given as the first character of the table
949
followed by one of the keywords ``replace'', ``augment'', or
950
``override'' to indicate
951
whether to replace, augment, or override the existing table.
953
operation is performed during the
955
instance initialization.
956
Each merge operation produces a new
957
translation resource value; if the original tables were shared by
958
other widgets, they are unaffected. If no directive is
959
specified, ``#replace'' is assumed.
963
At instance initialization
964
the XtNtranslations resource is first fetched. Then, if it was
965
not specified or did not contain ``#replace'', the
966
resource database is searched for the resource XtNbaseTranslations.
967
If XtNbaseTranslations is found, it is merged into the widget class
968
translation table. Then the widget <emphasis remap='I'>translations</emphasis> field is
969
merged into the result or into the class translation table if
970
XtNbaseTranslations was not found. This final table is then
971
stored into the widget <emphasis remap='I'>translations</emphasis> field. If the XtNtranslations
972
resource specified ``#replace'', no merge is done.
973
If neither XtNbaseTranslations or XtNtranslations are specified,
974
the class translation table is copied into the widget instance.
978
To completely remove existing translations, use
979
<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>.
982
<funcsynopsis id='XtUninstallTranslations'>
984
<funcdef>void <function>XtUninstallTranslations</function></funcdef>
985
<paramdef>Widget <parameter>w</parameter></paramdef>
992
<emphasis remap='I'>w</emphasis>
996
Specifies the widget from which the translations are to be removed. Must be of class Core or any subclass thereof.
1004
<xref linkend='XtUninstallTranslations' xrefstyle='select: title'/>
1005
function causes the entire translation table for the widget to be removed.
1009
<sect1 id="Using_Accelerators">
1010
<title>Using Accelerators</title>
1012
It is often desirable to be able to bind events in one widget to actions in
1015
it is often useful to be able to invoke menu actions from the keyboard.
1016
The Intrinsics provide a facility, called accelerators, that lets you
1018
An accelerator table is a translation table that is bound with its
1019
actions in the context of a particular widget, the <emphasis remap='I'>source</emphasis> widget.
1020
The accelerator table can then be installed on one or more <emphasis remap='I'>destination</emphasis> widgets.
1021
When an event sequence in the destination widget would cause an
1022
accelerator action to be taken, and if the source widget is sensitive,
1023
the actions are executed as though triggered by the same event sequence
1024
in the accelerator source
1025
widget. The event is
1026
passed to the action procedure without modification. The action
1027
procedures used within accelerators must not assume that the source
1028
widget is realized nor that any fields of the event are in reference
1029
to the source widget's window if the widget is realized.
1033
Each widget instance contains that widget's exported accelerator table
1035
Each class of widget exports a method that takes a
1036
displayable string representation of the accelerators
1037
so that widgets can display their current accelerators.
1038
The representation is the accelerator table in canonical
1039
translation table form (see Appendix B).
1040
The display_accelerator procedure pointer is of type
1041
<xref linkend='XtStringProc' xrefstyle='select: title'/>.
1044
<funcsynopsis id='XtStringProc'>
1046
<funcdef>typedef void <function>(*XtStringProc)</function></funcdef>
1047
<paramdef>Widget <parameter>w</parameter></paramdef>
1048
<paramdef>String <parameter>string</parameter></paramdef>
1055
<emphasis remap='I'>w</emphasis>
1059
Specifies the source widget that supplied the accelerators.
1065
<emphasis remap='I'>string</emphasis>
1069
Specifies the string representation of the accelerators for this widget.
1076
Accelerators can be specified in resource files,
1077
and the string representation is the same as for a translation table.
1079
the interpretation of the
1080
<function>#augment</function>
1082
<function>#override</function>
1083
directives applies to
1084
what will happen when the accelerator is installed;
1085
that is, whether or not the accelerator translations will override the
1086
translations in the destination widget.
1088
<function>#augment</function>,
1089
which means that the accelerator translations have lower priority
1090
than the destination translations.
1092
<function>#replace</function>
1093
directive is ignored for accelerator tables.
1097
To parse an accelerator table, use
1098
<xref linkend='XtParseAcceleratorTable' xrefstyle='select: title'/>.
1101
<funcsynopsis id='XtParseAcceleratorTable'>
1103
<funcdef>XtAccelerators <function>XtParseAcceleratorTable</function></funcdef>
1104
<paramdef>String <parameter>source</parameter></paramdef>
1111
<emphasis remap='I'>source</emphasis>
1115
Specifies the accelerator table to compile.
1123
<xref linkend='XtParseAcceleratorTable' xrefstyle='select: title'/>
1124
function compiles the accelerator table into an opaque internal representation.
1126
should set the XtNaccelerators resource of
1127
each widget that is to be activated by these translations
1128
to the returned value.
1132
To install accelerators from a widget on another widget, use
1133
<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>.
1136
<funcsynopsis id='XtInstallAccelerators'>
1138
<funcdef>void <function>XtInstallAccelerators</function></funcdef>
1139
<paramdef>Widget <parameter>destination</parameter></paramdef>
1140
<paramdef>Widget <parameter>source</parameter></paramdef>
1147
<emphasis remap='I'>destination</emphasis>
1151
Specifies the widget on which the accelerators are to be installed. Must be of class Core or any subclass thereof.
1157
<emphasis remap='I'>source</emphasis>
1161
Specifies the widget from which the accelerators are to come. Must be of class Core or any subclass thereof.
1169
<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>
1170
function installs the <emphasis remap='I'>accelerators</emphasis> resource value from
1171
<emphasis remap='I'>source</emphasis> onto <emphasis remap='I'>destination</emphasis>
1172
by merging the source accelerators into the destination translations.
1173
If the source <emphasis remap='I'>display_accelerator</emphasis> field is non-NULL,
1174
<xref linkend='XtInstallAccelerators' xrefstyle='select: title'/>
1175
calls it with the source widget and a string representation
1176
of the accelerator table,
1177
which indicates that its accelerators have been installed
1178
and that it should display them appropriately.
1179
The string representation of the accelerator table is its
1180
canonical translation table representation.
1184
As a convenience for installing all accelerators from a widget and all its
1185
descendants onto one destination, use
1186
<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>.
1189
<funcsynopsis id='XtInstallAllAccelerators'>
1191
<funcdef>void <function>XtInstallAllAccelerators</function></funcdef>
1192
<paramdef>Widget <parameter>destination</parameter></paramdef>
1193
<paramdef>Widget <parameter>source</parameter></paramdef>
1200
<emphasis remap='I'>destination</emphasis>
1204
Specifies the widget on which the accelerators are to be installed. Must be of class Core or any subclass thereof.
1210
<emphasis remap='I'>source</emphasis>
1214
Specifies the root widget of the widget tree
1215
from which the accelerators are to come. Must be of class Core or any subclass thereof.
1223
<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>
1224
function recursively descends the widget tree rooted at <emphasis remap='I'>source</emphasis>
1225
and installs the accelerators resource value
1226
of each widget encountered onto <emphasis remap='I'>destination</emphasis>.
1227
A common use is to call
1228
<xref linkend='XtInstallAllAccelerators' xrefstyle='select: title'/>
1229
and pass the application main window as the source.
1233
<sect1 id="KeyCode_to_KeySym_Conversions">
1234
<title>KeyCode-to-KeySym Conversions</title>
1236
The translation manager provides support for automatically translating
1237
KeyCodes in incoming key events into KeySyms.
1238
KeyCode-to-KeySym translator procedure pointers are of type
1239
<xref linkend='XtKeyProc' xrefstyle='select: title'/>.
1242
<funcsynopsis id='XtKeyProc'>
1244
<funcdef>typedef void <function>(*XtKeyProc)</function></funcdef>
1245
<paramdef>Display *<parameter>display</parameter></paramdef>
1246
<paramdef>KeyCode <parameter>keycode</parameter></paramdef>
1247
<paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
1248
<paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
1249
<paramdef>KeySym *<parameter>keysym_return</parameter></paramdef>
1256
<emphasis remap='I'>display</emphasis>
1260
Specifies the display that the KeyCode is from.
1266
<emphasis remap='I'>keycode</emphasis>
1270
Specifies the KeyCode to translate.
1276
<emphasis remap='I'>modifiers</emphasis>
1280
Specifies the modifiers to the KeyCode.
1286
<emphasis remap='I'>modifiers_return</emphasis>
1290
Specifies a location in which to store
1291
a mask that indicates the subset of all
1292
modifiers that are examined by the key translator for the specified keycode.
1298
<emphasis remap='I'>keysym_return</emphasis>
1302
Specifies a location in which to store the resulting KeySym.
1309
This procedure takes a KeyCode and modifiers and produces a KeySym.
1310
For any given key translator function and keyboard encoding,
1311
<emphasis remap='I'>modifiers_return</emphasis> will be a constant per KeyCode that indicates
1312
the subset of all modifiers that are examined by the key translator
1317
The KeyCode-to-KeySym translator procedure
1318
must be implemented such that multiple calls with the same
1319
<emphasis remap='I'>display</emphasis>, <emphasis remap='I'>keycode</emphasis>, and <emphasis remap='I'>modifiers</emphasis> return the same
1320
result until either a new case converter, an
1321
<xref linkend='XtCaseProc' xrefstyle='select: title'/>,
1323
<function>MappingNotify</function>
1328
The Intrinsics maintain tables internally to map KeyCodes to KeySyms
1329
for each open display. Translator procedures and other clients may
1330
share a single copy of this table to perform the same mapping.
1334
To return a pointer to the KeySym-to-KeyCode mapping table for a
1335
particular display, use
1336
<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>.
1339
<funcsynopsis id='XtGetKeysymTable'>
1341
<funcdef>KeySym *<function>XtGetKeysymTable</function></funcdef>
1342
<paramdef>Display *<parameter>display</parameter></paramdef>
1343
<paramdef>KeyCode *<parameter>min_keycode_return</parameter></paramdef>
1344
<paramdef>int *<parameter>keysyms_per_keycode_return</parameter></paramdef>
1351
<emphasis remap='I'>display</emphasis>
1355
Specifies the display whose table is required.
1361
<emphasis remap='I'>min_keycode_return</emphasis>
1365
Returns the minimum KeyCode valid for the display.
1371
<emphasis remap='I'>keysyms_per_keycode_return</emphasis>
1375
Returns the number of KeySyms stored for each KeyCode.
1382
<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>
1383
returns a pointer to the Intrinsics' copy of the
1384
server's KeyCode-to-KeySym table. This table must not be modified.
1385
There are <emphasis remap='I'>keysyms_per_keycode_return</emphasis> KeySyms associated with each
1386
KeyCode, located in the table with indices starting at index
1389
(test_keycode - min_keycode_return) * keysyms_per_keycode_return
1392
for KeyCode <emphasis remap='I'>test_keycode</emphasis>. Any entries that have no KeySyms associated
1393
with them contain the value
1394
<function>NoSymbol</function>.
1395
Clients should not cache the KeySym table but should call
1396
<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>
1397
each time the value is
1398
needed, as the table may change prior to dispatching each event.
1402
For more information on this table, see
1403
<olink targetdoc='libX11' targetptr='Manipulating_the_Keyboard_Encoding'>Section 12.7</olink> in
1404
<olink targetdoc='libX11' targetptr='libX11'>Xlib — C Language X Interface.</olink>.
1408
To register a key translator, use
1409
<xref linkend='XtSetKeyTranslator' xrefstyle='select: title'/>.
1412
<funcsynopsis id='XtSetKeyTranslator'>
1414
<funcdef>void <function>XtSetKeyTranslator</function></funcdef>
1415
<paramdef>Display *<parameter>display</parameter></paramdef>
1416
<paramdef>XtKeyProc <parameter>proc</parameter></paramdef>
1423
<emphasis remap='I'>display</emphasis>
1427
Specifies the display from which to translate the events.
1433
<emphasis remap='I'>proc</emphasis>
1437
Specifies the procedure to perform key translations.
1445
<xref linkend='XtSetKeyTranslator' xrefstyle='select: title'/>
1446
function sets the specified procedure as the current key translator.
1447
The default translator is
1448
<function>XtTranslateKey</function>,
1450
<xref linkend='XtKeyProc' xrefstyle='select: title'/>
1451
that uses the Shift, Lock, numlock, and group modifiers
1452
with the interpretations defined in <emphasis remap='I'>X Window System Protocol</emphasis>, Section 5.
1453
It is provided so that new translators can call it to get default
1454
KeyCode-to-KeySym translations and so that the default translator
1459
To invoke the currently registered KeyCode-to-KeySym translator,
1461
<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>.
1464
<funcsynopsis id='XtTranslateKeycode'>
1466
<funcdef>void <function>XtTranslateKeycode</function></funcdef>
1467
<paramdef>Display *<parameter>display</parameter></paramdef>
1468
<paramdef>KeyCode <parameter>keycode</parameter></paramdef>
1469
<paramdef>Modifiers <parameter>modifiers</parameter></paramdef>
1470
<paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
1471
<paramdef>KeySym *<parameter>keysym_return</parameter></paramdef>
1478
<emphasis remap='I'>display</emphasis>
1482
Specifies the display that the KeyCode is from.
1488
<emphasis remap='I'>keycode</emphasis>
1492
Specifies the KeyCode to translate.
1498
<emphasis remap='I'>modifiers</emphasis>
1502
Specifies the modifiers to the KeyCode.
1508
<emphasis remap='I'>modifiers_return</emphasis>
1512
Returns a mask that indicates the modifiers actually used
1513
to generate the KeySym.
1519
<emphasis remap='I'>keysym_return</emphasis>
1523
Returns the resulting KeySym.
1531
<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>
1532
function passes the specified arguments
1533
directly to the currently registered KeyCode-to-KeySym translator.
1537
To handle capitalization of nonstandard KeySyms, the Intrinsics allow
1538
clients to register case conversion routines.
1539
Case converter procedure pointers are of type
1540
<xref linkend='XtCaseProc' xrefstyle='select: title'/>.
1543
<funcsynopsis id='XtCaseProc'>
1545
<funcdef>typedef void <function>(*XtCaseProc)</function></funcdef>
1546
<paramdef>Display *<parameter>display</parameter></paramdef>
1547
<paramdef>KeySym <parameter>keysym</parameter></paramdef>
1548
<paramdef>KeySym *<parameter>lower_return</parameter></paramdef>
1549
<paramdef>KeySym *<parameter>upper_return</parameter></paramdef>
1556
<emphasis remap='I'>display</emphasis>
1560
Specifies the display connection for which the conversion is required.
1566
<emphasis remap='I'>keysym</emphasis>
1570
Specifies the KeySym to convert.
1576
<emphasis remap='I'>lower_return</emphasis>
1580
Specifies a location into which to store the lowercase equivalent for
1587
<emphasis remap='I'>upper_return</emphasis>
1591
Specifies a location into which to store the uppercase equivalent for
1599
If there is no case distinction,
1600
this procedure should store the KeySym into both return values.
1604
To register a case converter, use
1605
<xref linkend='XtRegisterCaseConverter' xrefstyle='select: title'/>.
1608
<funcsynopsis id='XtRegisterCaseConverter'>
1610
<funcdef>void <function>XtRegisterCaseConverter</function></funcdef>
1611
<paramdef>Display *<parameter>display</parameter></paramdef>
1612
<paramdef>XtCaseProc <parameter>proc</parameter></paramdef>
1613
<paramdef>KeySym <parameter>start</parameter></paramdef>
1614
<paramdef>KeySym <parameter>stop</parameter></paramdef>
1621
<emphasis remap='I'>display</emphasis>
1625
Specifies the display from which the key events are to come.
1631
<emphasis remap='I'>proc</emphasis>
1636
<xref linkend='XtCaseProc' xrefstyle='select: title'/>
1637
to do the conversions.
1643
<emphasis remap='I'>start</emphasis>
1647
Specifies the first KeySym for which this converter is valid.
1653
<emphasis remap='I'>stop</emphasis>
1657
Specifies the last KeySym for which this converter is valid.
1665
<xref linkend='XtRegisterCaseConverter' xrefstyle='select: title'/>
1666
registers the specified case converter.
1667
The <emphasis remap='I'>start</emphasis> and <emphasis remap='I'>stop</emphasis> arguments provide the inclusive range of KeySyms
1668
for which this converter is to be called.
1669
The new converter overrides any previous converters for KeySyms in that range.
1670
No interface exists to remove converters;
1671
you need to register an identity converter.
1672
When a new converter is registered,
1673
the Intrinsics refresh the keyboard state if necessary.
1674
The default converter understands case conversion for all
1675
Latin KeySyms defined in <emphasis remap='I'>X Window System Protocol</emphasis>, Appendix A.
1679
To determine uppercase and lowercase equivalents for a KeySym, use
1680
<xref linkend='XtConvertCase' xrefstyle='select: title'/>.
1683
<funcsynopsis id='XtConvertCase'>
1685
<funcdef>void <function>XtConvertCase</function></funcdef>
1686
<paramdef>Display *<parameter>display</parameter></paramdef>
1687
<paramdef>KeySym <parameter>keysym</parameter></paramdef>
1688
<paramdef>KeySym *<parameter>lower_return</parameter></paramdef>
1689
<paramdef>KeySym *<parameter>upper_return</parameter></paramdef>
1696
<emphasis remap='I'>display</emphasis>
1700
Specifies the display that the KeySym came from.
1706
<emphasis remap='I'>keysym</emphasis>
1710
Specifies the KeySym to convert.
1716
<emphasis remap='I'>lower_return</emphasis>
1720
Returns the lowercase equivalent of the KeySym.
1726
<emphasis remap='I'>upper_return</emphasis>
1730
Returns the uppercase equivalent of the KeySym.
1738
<xref linkend='XtConvertCase' xrefstyle='select: title'/>
1739
function calls the appropriate converter and returns the results.
1741
<xref linkend='XtKeyProc' xrefstyle='select: title'/>
1742
may need to use this function.
1746
<sect1 id="Obtaining_a_KeySym_in_an_Action_Procedure">
1747
<title>Obtaining a KeySym in an Action Procedure</title>
1749
When an action procedure is invoked on a
1750
<function>KeyPress</function>
1752
<function>KeyRelease</function>
1753
event, it often has a need to retrieve the KeySym and modifiers
1754
corresponding to the event that caused it to be invoked. In order to
1755
avoid repeating the processing that was just performed by the
1756
Intrinsics to match the translation entry, the KeySym and modifiers
1757
are stored for the duration of the action procedure and are made
1758
available to the client.
1762
To retrieve the KeySym and modifiers that matched the final event
1763
specification in the translation table entry, use
1764
<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>.
1767
<funcsynopsis id='XtGetActionKeysym'>
1769
<funcdef>KeySym <function>XtGetActionKeysym</function></funcdef>
1770
<paramdef>XEvent *<parameter>event</parameter></paramdef>
1771
<paramdef>Modifiers *<parameter>modifiers_return</parameter></paramdef>
1778
<emphasis remap='I'>event</emphasis>
1782
Specifies the event pointer passed to the action procedure by the Intrinsics.
1788
<emphasis remap='I'>modifiers_return</emphasis>
1792
Returns the modifiers that caused the match, if non-NULL.
1800
<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
1801
is called after an action procedure has been
1802
invoked by the Intrinsics and before that action procedure returns, and
1803
if the event pointer has the same value as the event pointer passed to
1804
that action routine, and if the event is a
1805
<function>KeyPress</function>
1807
<function>KeyRelease</function>
1809
<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
1810
returns the KeySym that matched the final
1811
event specification in the translation table and, if <emphasis remap='I'>modifiers_return</emphasis>
1812
is non-NULL, the modifier state actually used to generate this KeySym;
1813
otherwise, if the event is a
1814
<function>KeyPress</function>
1816
<function>KeyRelease</function>
1818
<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
1820
<xref linkend='XtTranslateKeycode' xrefstyle='select: title'/>
1821
and returns the results;
1823
<function>NoSymbol</function>
1824
and does not examine <emphasis remap='I'>modifiers_return</emphasis>.
1828
Note that if an action procedure invoked by the Intrinsics
1829
invokes a subsequent action procedure (and so on) via
1830
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>,
1831
the nested action procedure may also call
1832
<xref linkend='XtGetActionKeysym' xrefstyle='select: title'/>
1833
to retrieve the Intrinsics' KeySym and modifiers.
1837
<sect1 id="KeySym_to_KeyCode_Conversions">
1838
<title>KeySym-to-KeyCode Conversions</title>
1840
To return the list of KeyCodes that map to a particular KeySym in
1841
the keyboard mapping table maintained by the Intrinsics, use
1842
<xref linkend='XtKeysymToKeycodeList' xrefstyle='select: title'/>.
1845
<funcsynopsis id='XtKeysymToKeycodeList'>
1847
<funcdef>void <function>XtKeysymToKeycodeList</function></funcdef>
1848
<paramdef>Display *<parameter>display</parameter></paramdef>
1849
<paramdef>KeySym <parameter>keysym</parameter></paramdef>
1850
<paramdef>KeyCode **<parameter>keycodes_return</parameter></paramdef>
1851
<paramdef>Cardinal *<parameter>keycount_return</parameter></paramdef>
1858
<emphasis remap='I'>display</emphasis>
1862
Specifies the display whose table is required.
1868
<emphasis remap='I'>keysym</emphasis>
1872
Specifies the KeySym for which to search.
1878
<emphasis remap='I'>keycodes_return</emphasis>
1882
Returns a list of KeyCodes that have <emphasis remap='I'>keysym</emphasis>
1883
associated with them, or NULL if <emphasis remap='I'>keycount_return</emphasis> is 0.
1889
<emphasis remap='I'>keycount_return</emphasis>
1893
Returns the number of KeyCodes in the keycode list.
1901
<xref linkend='XtKeysymToKeycodeList' xrefstyle='select: title'/>
1902
procedure returns all the KeyCodes that have <emphasis remap='I'>keysym</emphasis>
1903
in their entry for the keyboard mapping table associated with <emphasis remap='I'>display</emphasis>.
1904
For each entry in the
1905
table, the first four KeySyms (groups 1 and 2) are interpreted as
1906
specified by <emphasis remap='I'>X Window System Protocol</emphasis>, Section 5. If no KeyCodes map to the
1907
specified KeySym, <emphasis remap='I'>keycount_return</emphasis> is zero and *<emphasis remap='I'>keycodes_return</emphasis> is NULL.
1911
The caller should free the storage pointed to by <emphasis remap='I'>keycodes_return</emphasis> using
1912
<xref linkend='XtFree' xrefstyle='select: title'/>
1913
when it is no longer useful. If the caller needs to examine
1914
the KeyCode-to-KeySym table for a particular KeyCode, it should call
1915
<xref linkend='XtGetKeysymTable' xrefstyle='select: title'/>.
1919
<sect1 id="Registering_Button_and_Key_Grabs_for_Actions">
1920
<title>Registering Button and Key Grabs for Actions</title>
1922
To register button and key grabs for a widget's window according to the
1923
event bindings in the widget's translation table, use
1924
<xref linkend='XtRegisterGrabAction' xrefstyle='select: title'/>.
1927
<funcsynopsis id='XtRegisterGrabAction'>
1929
<funcdef>void <function>XtRegisterGrabAction</function></funcdef>
1930
<paramdef>XtActionProc <parameter>action_proc</parameter></paramdef>
1931
<paramdef>Boolean <parameter>owner_events</parameter></paramdef>
1932
<paramdef>unsigned int <parameter>event_mask</parameter></paramdef>
1933
<paramdef>int <parameter>pointer_mode</parameter></paramdef>
1940
<emphasis remap='I'>action_proc</emphasis>
1944
Specifies the action procedure to search for in translation tables.
1950
<emphasis remap='I'>owner_events</emphasis>
1959
<emphasis remap='I'>event_mask</emphasis>
1968
<emphasis remap='I'>pointer_mode</emphasis>
1976
<emphasis remap='I'>keyboard_mode</emphasis>
1980
Specify arguments to
1981
<xref linkend='XtGrabButton' xrefstyle='select: title'/>
1983
<xref linkend='XtGrabKey' xrefstyle='select: title'/>.
1990
<xref linkend='XtRegisterGrabAction' xrefstyle='select: title'/>
1991
adds the specified <emphasis remap='I'>action_proc</emphasis> to a list known to
1992
the translation manager. When a widget is realized, or when the
1993
translations of a realized widget or the accelerators installed on a
1994
realized widget are modified, its translation table and any installed
1995
accelerators are scanned for action procedures on this list.
1996
If any are invoked on
1997
<function>ButtonPress</function>
1999
<function>KeyPress</function>
2000
events as the only or final event
2001
in a sequence, the Intrinsics will call
2002
<xref linkend='XtGrabButton' xrefstyle='select: title'/>
2004
<xref linkend='XtGrabKey' xrefstyle='select: title'/>
2005
for the widget with every button or KeyCode which maps to the
2006
event detail field, passing the specified <emphasis remap='I'>owner_events</emphasis>, <emphasis remap='I'>event_mask</emphasis>,
2007
<emphasis remap='I'>pointer_mode</emphasis>, and <emphasis remap='I'>keyboard_mode</emphasis>. For
2008
<function>ButtonPress</function>
2009
events, the modifiers
2010
specified in the grab are determined directly from the translation
2011
specification and <emphasis remap='I'>confine_to</emphasis> and <emphasis remap='I'>cursor</emphasis> are specified as
2012
<function>None</function>.
2014
<function>KeyPress</function>
2015
events, if the translation table entry specifies colon (:) in
2016
the modifier list, the modifiers are determined by calling the key
2017
translator procedure registered for the display and calling
2018
<xref linkend='XtGrabKey' xrefstyle='select: title'/>
2019
for every combination of standard modifiers which map the KeyCode to
2020
the specified event detail KeySym, and ORing any modifiers specified in
2021
the translation table entry, and <emphasis remap='I'>event_mask</emphasis> is ignored. If the
2022
translation table entry does not specify colon in the modifier list,
2023
the modifiers specified in the grab are those specified in the
2024
translation table entry only. For both
2025
<function>ButtonPress</function>
2027
<function>KeyPress</function>
2028
events, don't-care modifiers are ignored unless the translation entry
2029
explicitly specifies ``Any'' in the <emphasis remap='I'>modifiers</emphasis> field.
2033
If the specified <emphasis remap='I'>action_proc</emphasis> is already registered for the calling
2034
process, the new values will replace the previously specified values
2035
for any widgets that become realized following the call, but existing
2036
grabs are not altered on currently realized widgets.
2040
When translations or installed accelerators are modified for a
2041
realized widget, any previous key or button grabs registered
2042
as a result of the old bindings are released if they do not appear in
2043
the new bindings and are not explicitly grabbed by the client with
2044
<xref linkend='XtGrabKey' xrefstyle='select: title'/>
2046
<xref linkend='XtGrabButton' xrefstyle='select: title'/>.
2050
<sect1 id="Invoking_Actions_Directly">
2051
<title>Invoking Actions Directly</title>
2053
Normally action procedures are invoked by the Intrinsics when an
2054
event or event sequence arrives for a widget. To
2055
invoke an action procedure directly, without generating
2056
(or synthesizing) events, use
2057
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>.
2060
<funcsynopsis id='XtCallActionProc'>
2062
<funcdef>void <function>XtCallActionProc</function></funcdef>
2063
<paramdef>Widget <parameter>widget</parameter></paramdef>
2064
<paramdef>String <parameter>action</parameter></paramdef>
2065
<paramdef>XEvent *<parameter>event</parameter></paramdef>
2066
<paramdef>String *<parameter>params</parameter></paramdef>
2067
<paramdef>Cardinal <parameter>num_params</parameter></paramdef>
2074
<emphasis remap='I'>widget</emphasis>
2078
Specifies the widget in which the action is to be invoked. Must be of class Core or any subclass thereof.
2084
<emphasis remap='I'>action</emphasis>
2088
Specifies the name of the action routine.
2094
<emphasis remap='I'>event</emphasis>
2098
Specifies the contents of the <emphasis remap='I'>event</emphasis> passed to the action routine.
2104
<emphasis remap='I'>params</emphasis>
2108
Specifies the contents of the <emphasis remap='I'>params</emphasis> passed to the action routine.
2114
<emphasis remap='I'>num_params</emphasis>
2118
Specifies the number of entries in <emphasis remap='I'>params</emphasis>.
2125
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>
2126
searches for the named action routine in the same
2127
manner and order as translation tables are bound, as described in
2128
Section 10.1.2, except that application action tables are searched, if
2129
necessary, as of the time of the call to
2130
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>.
2132
the action routine is invoked with the specified widget, event pointer,
2133
and parameters. It is the responsibility of the caller to ensure that
2134
the contents of the <emphasis remap='I'>event</emphasis>, <emphasis remap='I'>params</emphasis>, and <emphasis remap='I'>num_params</emphasis> arguments are
2135
appropriate for the specified action routine and, if necessary, that
2136
the specified widget is realized or sensitive. If the named action
2137
routine cannot be found,
2138
<xref linkend='XtCallActionProc' xrefstyle='select: title'/>
2139
generates a warning message and returns.
2143
<sect1 id="Obtaining_a_Widget_s_Action_List">
2144
<title>Obtaining a Widget's Action List</title>
2146
Occasionally a subclass will require the pointers to one or more of
2147
its superclass's action procedures. This would be needed, for
2148
example, in order to envelop the superclass's action. To retrieve
2149
the list of action procedures registered in the superclass's
2150
<emphasis remap='I'>actions</emphasis> field, use
2151
<xref linkend='XtGetActionList' xrefstyle='select: title'/>.
2154
<funcsynopsis id='XtGetActionList'>
2156
<funcdef>void <function>XtGetActionList</function></funcdef>
2157
<paramdef>WidgetClass <parameter>widget_class</parameter></paramdef>
2158
<paramdef>XtActionList *<parameter>actions_return</parameter></paramdef>
2159
<paramdef>Cardinal *<parameter>num_actions_return</parameter></paramdef>
2166
<emphasis remap='I'>widget_class</emphasis>
2170
Specifies the widget class whose actions are to be returned.
2176
<emphasis remap='I'>actions_return</emphasis>
2180
Returns the action list.
2186
<emphasis remap='I'>num_actions_return</emphasis>
2190
Returns the number of action procedures declared by the class.
2197
<xref linkend='XtGetActionList' xrefstyle='select: title'/>
2198
returns the action table defined by the specified
2199
widget class. This table does not include actions defined by the
2200
superclasses. If <emphasis remap='I'>widget_class</emphasis> is not initialized, or is not
2201
<function>coreWidgetClass</function>
2202
or a subclass thereof, or if the class does not define any actions,
2203
*<emphasis remap='I'>actions_return</emphasis> will be NULL and *<emphasis remap='I'>num_actions_return</emphasis>
2205
If *<emphasis remap='I'>actions_return</emphasis> is non-NULL the client is responsible for freeing
2207
<xref linkend='XtFree' xrefstyle='select: title'/>
2208
when it is no longer needed.