[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide



Enter Actions

The X Window System generates an EnterWindow event whenever the pointer crosses into your widget. In order to get the proper traversal behavior, whatever action is bound to EnterWindow needs to call the PrimitiveEnter action of XmPrimitive. This action encapsulates the appropriate Motif response to an EnterWindow event. In short, this action does the following:

  1. Gives this widget the keyboard focus if the keyboard focus policy is XmImplicit. (If the keyboard focus policy is XmExplicit, the PrimitiveEnter method does not change the keyboard focus.)

  2. Highlights the widget if primitive.highlight_on_enter is set to True.

    The simplest way to invoke PrimitiveEnter is to associate it with EnterWindow in the actions array as follows:

    static XtActionsRec ActionsList[] = {
          {"Enter",         PrimitiveEnter},
          ...
    }

    If your widget requires special behavior on an EnterWindow, then your widget's EnterWindow action should envelop PrimitiveEnter. For example, the following action reacts properly:

    MyEnterEventMethod(Widget    w,
                       XEvent   *event,
                       String   *params,
                       Cardinal *num_params)
    {
     /* special behavior on <EnterWindow> */
       ...
     
     /* Call the PrimitiveEnter function. */
       XtCallActionProc(w, "PrimitiveEnter", event, params, num_params);
    }

  3. [ Previous | Next | Contents | Glossary | Home | Search ]