A function that determines which component receives keyboard events when a widget has the focus
Format
#include <Xm/Xm.h> Boolean XmProcessTraversal Widget widgetXmTraversalDirection direction
DESCRIPTION
XmProcessTraversal determines which component of a hierarchy receives keyboard events when the hierarchy that contains the given widget has keyboard focus.
XmProcessTraversal changes focus only when the keyboard focus policy of the widget hierarchy is explicit. If the XmNkeyboardFocusPolicy of the nearest shell ancestor of the given widget is not XmEXPLICIT, XmProcessTraversal returns False without making any focus changes.
In order to be eligible to receive keyboard focus when the shell's XmNkeyboardFocusPolicy is XmEXPLICIT, a widget or gadget must meet the following conditions:
In a ScrolledWindow with an XmNscrollingPolicy of XmAUTOMATIC, a widget that is obscured because it is not within the clip window may be able to receive focus if some part of the widget is within the work area and if an XmNtraverseObscuredCallback routine can make the widget at least partially visible by scrolling the window.
In general only primitives, gadgets, and Drawing Area are eligible to receive focus. Most managers cannot receive focus even if they meet all these conditions.
The direction argument identifies the kind of traversal action to take. The descriptions of these actions below refer to traversable non-tab-group widgets and traversable tab groups.
A tab group is a widget whose XmNnavigationType is:
The hierarchy to be traversed is that containing the widget argument. This hierarchy is traversed only up to the nearest shell; XmProcessTraversal does not move focus from one shell to another. If the shell containing widget does not currently have the focus, any change that XmProcessTraversal makes to the element with focus within that shell does not take effect until the next time the shell receives focus.
XmProcessTraversal begins the traversal action from the widget in the hierarchy that currently has keyboard focus or that last had focus when the user traversed away from the shell hierarchy.
The value of the direction argument determines which of three kinds of traversal action to take:
These actions do not move focus from one tab group to another. The actions first determine the containing tab group. This is the tab group containing the widget that currently has focus. The actions traverse only to a non-tab-group widget within the containing tab group.
A non-tab-group widget is eligible for this kind of traversal if the widget is traversable and has no tab group ancestors up to the containing tab group. If the tab group contains no traversable non-tab-group widgets, XmProcessTraversal returns False.
Following are the possible values of the direction argument. Note that when actions wrap, wrapping occurs in the traversal direction. The following describes what happens in a left to right environment:
In a right to left environment, at the right side of the tab group, this action wraps to the non-tab-group widget at the left side and next toward the top. At the rightmost widget in the upper row of the tab group this action wraps to the non-tab-group widget at the leftmost widget in the bottom row.
If the XmNnavigationType of the containing tab group is XmEXCLUSIVE_TAB_GROUP, focus moves to the next traversable non-tab-group widget in the tab group, proceeding in the order in which the widgets appear in their parents' XmNchildren lists. After the last widget in the tab group, this action wraps to the first non-tab-group widget.
In a right to left environment, at the left side of the tab group this action wraps to the non-tab-group widget at the right side and next toward the bottom. At the leftmost widget in the bottom row of the tab group this action wraps to the non-tab-group widget at the rightmost widget in the upper row.
If the XmNnavigationType of the containing tab group is XmEXCLUSIVE_TAB_GROUP, focus moves to the previous traversable non-tab-group widget in the tab group, proceeding in the reverse order in which the widgets appear in their parents' XmNchildren lists. After the first widget in the tab group, this action wraps to the last non-tab-group widget.
In a right to left environment, at the bottom of the tab group this action wraps to the non-tab-group widget at the top and next toward the left. At the bottom widget of the leftmost widget of the tab group this action wraps to the non-tab-group widget at the top widget of the rightmost column.
If the XmNnavigationType of the containing tab group is XmEXCLUSIVE_TAB_GROUP, focus moves to the next traversable non-tab-group widget in the tab group, proceeding in the order in which the widgets appear in their parents' XmNchildren lists. After the last widget in the tab group, this action wraps to the first non-tab-group widget.
In a right to left environment, at the top of the tab group this action wraps to the non-tab-group widget at the bottom and next toward the right. At the top widget of the right most column of the tab group this action wraps to the non-tab-group widget at the bottom widget of the leftmost column.
If the XmNnavigationType of the containing tab group is XmEXCLUSIVE_TAB_GROUP, focus moves to the previous traversable non-tab-group widget in the tab group, proceeding in the reverse order in which the widgets appear in their parents' XmNchildren lists. After the first widget in the tab group, this action wraps to the last non-tab-group widget.
If the XmNnavigationType of the containing tab group is XmEXCLUSIVE_TAB_GROUP, focus moves to the first traversable non-tab-group widget in the tab group, according to the order in which the widgets appear in their parents' XmNchildren lists.
Following are the possible values of the direction argument. If any tab group in the current widget hierarchy has an XmNnavigationType of XmEXCLUSIVE_TAB_GROUP, traversal of tab groups in the hierarchy proceeds to widgets in the order in which their XmNnavigationType resources were specified as XmEXCLUSIVE_TAB_GROUP or XmSTICKY_TAB_GROUP.:
Following are the possible values of the direction argument:
Using XmProcessTraversal to traverse to MenuBars, Pulldown menu panes, or Popup menu panes is not supported.
XmProcessTraversal cannot be called recursively. In particular, an application cannot call this routine from an XmNfocusCallback or XmNlosingFocusCallback procedure.
RETURN
Returns True if the traversal action succeeded. Returns False if the XmNkeyboardFocusPolicy of the nearest shell ancestor of widget is not XmEXPLICIT, if the traversal action finds no traversable widget to receive focus, or if the call to the routine has invalid arguments.
RELATED
XmGetVisibility (3) and XmIsTraversable (3).