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

To hold the icon's image, Workbench uses an Intuition gadget structure,
defined in <intuition/intuition.h>.  workbench restricts some of the
values of the gadget.  All unused fields should be set to 0 or NULL.  The
Intuition gadget structure members that Workbench icons use are listed
below.

    Gadget Names in Assembly Language Are Different.
    ------------------------------------------------
    The assembly language version of the gadget structure has leading
    "gg_" for each variable name.

width
    This is the width (in pixels) of the icon's active region.  Any mouse
    button press within this range will be interpreted as having selected
    this icon.

height
    This is the height (in pixels) of the icon's active region.  Any
    mouse button press within this range will be interpreted as having
    selected this icon.

flags
    The gadget must be of type gadgimage.  three highlight modes are
    supported:   gadghcomp, gadghimage, and gadgbackfill.  gadghcomp
    complements everything within the area defined by currentx, currenty,
    Width, Height.  GADGHIMAGE uses an alternate selection image.
    GADGBACKFILL is similar to GADGHCOMP, but ensures that there is no
    "ring" around the selected image.  It does this by first
    complementing the image, and then flooding all color 3 pixels that
    are on the border of the image to color 0.  All other flag bits
    should be 0.

activation
    The activation should have only relverify and gadgimmediate set.

type
    The gadget type should be boolgadget.

gadgetrender
    Set this to an appropriate image structure.

selectrender
    Set this to an appropriate alternate Image structure if and only if
    the highlight mode is gadghimage.

The image structure is typically the same size as the gadget, except that
height is often one pixel less than the gadget height. this allows a blank
line between the icon image and the icon name. The image depth must be 2;
planepick must be 3; and planeonoff should be 0. the nextimage field
should be null.