[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

Here is the specification for the Gadget structure defined in
<intuition/intuition.h>.  you create an instance of this structure for
each gadget you place in a window or requester:

    struct Gadget
        {
        struct Gadget *NextGadget;
        WORD LeftEdge, TopEdge;
        WORD Width, Height;
        UWORD Flags;
        UWORD Activation;
        UWORD GadgetType;
        APTR GadgetRender;
        APTR SelectRender;
        struct IntuiText *GadgetText;
        LONG MutualExclude;
        APTR SpecialInfo;
        UWORD GadgetID;
        APTR UserData;
        };

NextGadget
    Applications may create lists of gadgets that may be added to a
    window or requester with a single instruction.  NextGadget is a
    pointer to the next gadget in the list.  The last gadget in the list
    should have a NextGadget value of NULL.

    When gadgets are added or removed, Intuition will modify the
    appropriate NextGadget fields to maintain a correctly linked list of
    gadgets for that window or requester.  However, removing one or more
    gadgets does not reset the last removed gadget's NextGadget field to
    NULL.

LeftEdge, TopEdge, Width, Height
    These variables describe the location and dimensions of the select
    box of the gadget.  Both location and dimensions can be either
    absolute values or else relative to the edges and size of the window
    or requester that contains the gadget.

    LeftEdge and TopEdge are relative to one of the corners of the
    display element, according to how gflg_relright and gflg_relbottom
    are set in the Flags variable (see below).

    Width and Height are either absolute dimensions or a negative
    increment to the width abd height of a requester or a window,
    according to to how the gflg_relwidth and gflg_relheight flags are
    set (see below).

Flags
    The Flags field is shared by the program and Intuition.  See the
    section below on "gadget flags" for a complete description of all the
    flag bits.

Activation
    This field is used for information about some gadget attributes.  See
    the "gadget activation flags" section below for a description of the
    various flags.

GadgetType
    This field contains information about gadget type and in what sort of
    display element the gadget is to be displayed.  One of the following
    flags must be set to specify the type:

    GTYP_BOOLGADGET
        boolean gadget type.

    GTYP_STRGADGET
        string gadget type.  for an integer gadget, also set the
        gact_longint flag.  see the "gadget activation flags" section
        below.

    GTYP_PROPGADGET
        proportional gadget type.

    GTYP_CUSTOMGADGET
        Normally not set by the application.  Used by custom boopsi
        gadget types, discussed in the "boopsi" chapter.

    The following gadget types may be set in addition to one of the above
    types.  None of the following types are required:

    GTYP_GZZGADGET
        If the gadget is placed in a gimmezerozero window, setting this
        flag will place the gadget in the border layer, out of the inner
        window.  If this flag is not set, the gadget will go into the
        inner window.  Do not set this bit if this gadget is not placed
        in a GimmeZeroZero window.

    GTYP_REQGADGET
        Set this bit if this gadget is placed in a requester.

GadgetRender
    A pointer to the image or border structure containing the graphics
    imagery of this gadget.  If this field is set to NULL, no rendering
    will be done.

    If the graphics of this gadget are implemented with an image
    structure, this field should contain a pointer to that structure and
    the gflg_gadgimage flag must be set.  if a border structure is used,
    this field should contain a pointer to the Border structure, and the
    GFLG_GADGIMAGE bit must be cleared.

SelectRender
    If the application does not use an alternate image for highlighting,
    set this field to NULL.  Otherwise, if the flag gflg_gadghimage is
    set, this field must contain a pointer to an image or border
    structure.  The gflg_gadgimage flag determines the type of the
    rendering. Provide a pointer to an intuitext structure to include a
    text component to the gadget.  Multiple IntuiText structures may be
    chained.  Set this field to NULL if the gadget has no associated text.

GadgetText
    Provide a pointer to an intuitext structure to include a text
    component to the gadget.  Multiple IntuiText structures may be
    chained.  Set this field to NULL if the gadget has no associated text.

    The offsets in the intuitext structure are relative to the top left
    of the gadget's select box.

MutualExclude
    This field is currently ignored by Intuition, but is reserved. Do not
    store information here. Starting with V36, if the GadgetType is
    GTYP_CUSTOMGADGET this field is used to point to a Hook for the
    custom gadget.

SpecialInfo
    SpecialInfo contains a pointer to an extension structure which
    contains the special information needed by the gadget.

    If this is a proportional gadget, this variable must contain a
    pointer to an instance of a propinfo data structure. if this is a
    string or integer gadget, this variable must contain a pointer to an
    instance of a stringinfo data structure. if this is a boolean gadget
    with gact_boolextend activation, this variable must contain a pointer
    to an instance of a boolinfo data structure. otherwise, this variable
    is ignored.

GadgetID
    This variable is for application use and may contain any value.  It
    is often used to identify the specific gadget within an event
    processing loop.  This variable is ignored by Intuition.

UserData
    This variable is for application use and may contain any value.  It
    is often used as a pointer to a data block specific to the
    application or gadget.  This variable is ignored by Intuition.

 gadget flags    gadget activation flags