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.
[Back to Amiga Developer Docs]