When the resource traversalOn is set to True (either at cre ation time, or via a XtSetValues later), a set of transla tions is added to the widget. If the widget's parent is also a subclass of Common, these translations will then implement keyboard traversal, using the cursor keys (up, down, prev, etc.) Of course, when the widget already uses these keys for other purposes, the keyboard traversal will not work.
Public variables
___________________________________________________________________________________
XtNhighlightThickness
Keyboard focus is indicated by border highlighting.
When keyboard traversal is on and the widget receives
the focus, the highlight border is filled with the
highlight color or tile. If the widget does not have
the focus, the area is left in the default background.
XtNhighlightColor
The highlight border can have a color or it can be
tiled with a pixmap. Whichever of the resources high
lightColor or highlightPixmap is set latest, is used.
When both are set, the pixmap is used.
XtNhighlightPixmap
The highlightPixmap can be set to a pixmap with which
the highlight border will be tiled. Only one of high
lightPixmap and highlightColor can be set, see above.
XtNnextTop
When an application has several top level windows, it
should have a way of setting the focus between windows.
The Enter key in any widget with keyboard traversal on
normally invokes the traverseNextTop action, that will
call the callbacks of the topmost Common (or subclass)
widget in the hierarchy. The callback may set the focus
to another top level widget, with XtCallAcceptFocus.
XtNuserData
The resource userData is provided for applications that
want to attach their own data to a widget. It is not
used by the widget itself in any way.
def XfwfTop = 4 def XfwfBottom = 8
For convenience, the eight possible combinations also have symbolic names.
def XfwfTopLeft = (XfwfTop +XfwfLeft )
def XfwfTopRight = (XfwfTop +XfwfRight )
def XfwfBottomLeft = (XfwfBottom +XfwfLeft )
def XfwfBottomRight = (XfwfBottom +XfwfRight )
The directions of traversal are used as arguments to the traverse method. They are probably only useful to sub classes.
type
TraversalDirection = enum {
TraverseLeft, TraverseRight, TraverseUp, TraverseDown,
TraverseNext, TraversePrev, TraverseHome, TraverseNextTop }
To know the inside area of a Common widget might be useful to other widgets than subclasses alone. Calling XfwfCallCom puteInside will call the compute_inside method, if avail able.
XfwfCallComputeInside( $, Position * x, Position * y, Dimension * w, Dimension * h)
Another convenience function is XfwfCallFrameWidth, which uses the method total_frame_width to compute the thickness of the frame that the widget will draw.
Dimension XfwfCallFrameWidth( $)
focusIn
focusOut
This action removes the highlight border.
traverseDown
This and the following actions all call the traverse method of the widget's parent, with the appropiate direction arguments. traverseDown tries to set the focus to a widget that is located roughly below the current one.
traverseUp
The action tries to set the focus to a widget that is above the this one.
traverseLeft
traverseLeft looks for a widget to the left of the cur rent one and sets the keyboard focus to that.
traverseRight
The action looks for a widget that will aceept the focus to the right of the current one.
traverseNext
The next sibling gets the focus. The precise order is determined by the parent, but usually is will be the order in which the widgets were created. If there is no suitable sibling, the request is passed to the grand parent, so that an `aunt widget' or other relation can get the focus.
traversePrev
The previous widget gets the focus. See also the description of traverseNext above.
traverseNextTop
traverseNextTop finds the topmost ancestor that is a subclass of Common and lets it call the nextTop call backs that have been registered there. These callbacks can be used by an application that has multiple top level windows to set the focus to another window.
traverseHome
The action sets the focus to the sibling widget that is closest to the upper left corner of the parent.
traverseCurrent
The traverseCurrent action can be used by widgets to set the focus to themselves. It is not used in the set of translations that is added when traversalOn is set to True.