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



The Instance Data Members of XmManager

The XmManager widget maintains the values of its resources inside the manager structure. Each resource value is stored in a different field of manager. For example, the value of the XmNshadowThickness resource is stored in the manager.shadow_thickness field. Your manager widget can access any of these fields; for example:

/* Add 2 pixels to the current shadow thickness */
 my_manager->my_manager.shadow_thickness += 2;

In addition to all the resource values, the manager structure also holds several fields not tied to resources. Widget writers should become familiar with the fields shown in the following subsections.

The manager.accelerator_widget Field

The accelerator_widget field is declared as follows:

Widget        accelerator_widget;

The manager.accelerator_widget field holds the name of a widget whose accelerators will be automatically propagated to all new children of this manager.

Your own manager widget may modify this field.

Suppose your own manager widget contains accelerators to be installed on all its descendants. In this case, your manager's initialize method should set the manager.accelerator_widget field to the widget ID of your manager widget. Motif will install these accelerators in all the descendants of your manager widget. Furthermore, Motif will copy the value of the manager.accelerator_widget field in your widget to all manager children of your widget.

The manager.active_child Field

The active_child field is declared as follows:

Widget    active_child;

The manager.active_child field holds the widget ID of the gadget that has keyboard traversal focus. A value of NULL indicates that none of this manager's gadgets currently have keyboard traversal focus.

Your own manager widget should not modify the value of this field.

The manager.background_GC Field

The background_GC field is declared as follows:

GC        background_GC;

XmManager creates the starting GC, which is stored in the manager.background_GC field. Your widget cannot modify the fields in this GC; however, your widget can deallocate this GC and create a new GC more to your liking. The values in this GC are the default values generated by XtGetGC, except those noted in the following list:

  1. The foreground is set to the value of the XmNbackgroundPixel resource of Core.

  2. The background is set to the value of the XmNforeground resource of XmManager.

    If the widget user specifies a valid pixmap for the XmNbackgroundPixmap resource of Core, then

    1. The tile field is set to the value of the pixmap named by the XmNbackgroundPixmap resource.

    2. The fill_style field is set to FillTiled.

      On the other hand, a widget user might not specify a value for the XmNbackgroundPixmap resource, or might specify a bad value for the resource. In either case, the values of tile and fill_style are the defaults generated by XtGetGC.

    3. The manager.bottom_shadow_GC Field

      The bottom_shadow_GC field is declared as follows:

      GC        bottom_shadow_GC;

      XmManager creates the starting GC stored in the manager.bottom_shadow_GC field. Your widget cannot modify the fields in this GC; however, your widget can deallocate this GC and create a new GC more to your liking. The values in this GC are the default values generated by XtGetGC, except those noted in the following list:

      1. The foreground is set to the value of the XmNbottomShadowColor resource of XmManager.

      2. The background is set to the value of the XmNforeground resource of XmManager.

        If the widget user specifies a valid pixmap for the XmNbottomShadowPixmap resource of XmManager, then

        1. The tile field is set to the value of the pixmap named by the XmNbottomShadowPixmap resource.

        2. The fill_style field is set to FillTiled.

          On the other hand, a widget user might not specify a value for the XmNbottomShadowPixmap resource, or might specify a bad value for the resource. In either case, the values of tile and fill_style are the defaults generated by XtGetGC.

        3. The manager.eligible_for_multi_button_event Field

          The eligible_for_multi_button_event field is declared as follows:

          XmGadget  eligible_for_multi_button_event;

          Motif uses this field to implement multiclick events on gadgets.

          Your widget should not alter the value in this field.

          The manager.event_handler_added Field

          The event_handler_added field is declared as follows:

          Boolean   event_handler_added;

          The event_handler_added field is a flag whose initial value is False. The initialize method in the ConstraintClassPart of XmManager sets this flag to True when it installs a gadget event handler.

          Your own manager widget should not modify the value of this field.

          The manager.has_focus Field

          The has_focus field is declared as follows:

          Boolean   has_focus;

          XmManager sets this field to True when the manager widget has focus and sets this field to False when the manager widget does not. Note that, if a child widget has focus, then XmManager sets this field to False. However, if a child gadget has focus, then XmManager sets this field to True.

          Your own manager widget should not modify the value of this field.

          The manager.highlight_GC Field

          The highlight_GC field is declared as follows:

          GC        highlight_GC;

          XmManager creates the starting GC, which is stored in the manager.highlight_GC field. Your widget can not modify the fields in this GC; however, your widget can deallocate this GC and create a new GC more to your liking.

          The values in this GC are the default values generated by XtGetGC, except those noted in the following list:

          1. The foreground is set to the value of the XmNhighlightColor resource of XmManager.

          2. The background is set to the value of the XmNbackground resource of Core.

            If the widget user specifies a valid pixmap for the XmNhighlightPixmap resource of XmManager, then

            1. The tile field is set to the value of the pixmap named by the XmNhighlightPixmap resource.

            2. The fill_style field is set to FillTiled.

              On the other hand, a widget user might not specify a value for the XmNhighlightPixmap resource, or might specify a bad value for the resource. In either case, the values of tile and fill_style are the defaults generated by XtGetGC.

            3. The manager.highlighted_widget Field

              The highlighted_widget field is declared as follows:

              Widget   highlighted_widget;

              The highlight_widget fields holds the name of the gadget currently pointed to by the pointer (typically, a mouse). If the pointer does not point to a gadget, then the value of this field will be NULL.

              Your own manager widget should not modify the value of this field.

              The manager.keyboard_list Field

              The keyboard_list field is declared as follows:

              XmKeyboardData *keyboard_list;

              Motif no longer uses this field.

              The manager.num_keyboard_entries Field

              The num_keyboard_entries field is declared as follows:

              short     num_keyboard_entries;

              Motif does not currently use this field.

              The manager.selected_gadget Field

              The selected_gadget field is declared as follows:

              XmGadget  selected_gadget;

              Motif initializes the selected_gadget field to NULL. When a user selects a gadget (typically, by pressing a mouse button), Motif arms the gadget and sets selected_gadget to the ID of the selected gadget. When the user releases the mouse button, Motif disarms the gadget and sets selected_gadget to NULL.

              Your widget should not alter the value in this field.

              The manager.size_keyboard_list Field

              The size_keyboard_list field is declared as follows:

              short     size_keyboard_list;

              Motif does not currently use this field.

              The manager.top_shadow_GC Field

              The top_shadow_GC field is declared as follows:

              GC        top_shadow_GC;

              XmManager creates the starting GC stored in the top_shadow_GC field. Your widget can not modify the fields in this GC; however, your widget can deallocate this GC and create a new GC more to your liking.

              The values in this GC are the default values generated by XtGetGC, except those noted in the following list:

              1. The foreground is set to the value of the XmNtopShadowColor resource of XmManager.

              2. The background is set to the value of the XmNforeground resource of XmManager.

                If the widget user specifies a valid pixmap for the XmNtopShadowPixmap resource of XmManager, then

                1. The tile field is set to the value of the pixmap named by the XmNtopShadowPixmap resource.

                2. The fill_style field is set to FillTiled.

                  On the other hand, a widget user might not specify a value for the XmNtopShadowPixmap resource, or might specify a bad value for the resource. In either case, the values of tile and fill_style are the defaults generated by XtGetGC.


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