[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

If the application requires a specialized gadget which does not fit into
any of the defined GadTools kinds but would still like to use the GadTools
gadget creation and deletion functions, it may create a GadTools generic
gadget and use it any way it sees fit.  In fact, all of the kinds of
GadTools gadgets are created out of GadTools GENERIC_KIND gadgets.

The gadget that gets created will heed almost all the information
contained in the NewGadget structure supplied.

If ng_GadgetText is supplied, the Gadget's GadgetText will point to an
IntuiText structure with the provided string and font.  However, do not
specify any of the PLACETEXT ng_Flags, as they are currently ignored by
GENERIC_KIND gadgets.  PLACETEXT flags may be supported by generic
GadTools gadgets in the future.

It is up to the program to set the Flags, Activation, GadgetRender,
SelectRender, MutualExclude and SpecialInfo fields of the Gadget structure.

The application must also set the GadgetType field, but be certain to
preserve the bits set by CreateGadget(). For instance, to make a gadget
boolean, use:

    gad->GadgetType |= GTYP_BOOLGADGET;

and not

    gad->GadgetType = GTYP_BOOLGADGET;

Using direct assignment, (the = operator), clears all other flags in the
GadgetType field and the gadget may not be properly freed by FreeGadgets().


[Back to Amiga Developer Docs]