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

The user operates a gadget by pressing the select button while the mouse
pointer is within the gadget's select box.  Intuition provides two ways of
notifying your program about the user operating a gadget.  If your
application needs immediate notification when the gadget is chosen, set
the GACT_IMMEDIATE flag in the gadget's Activation field.  Intuition will
send an IDCMP_GADGETDOWN message to the window's UserPort when it detects
the mouse select button being pressed on the gadget.

If the application needs notification when the gadget is released, i.e.,
when the user releases the mouse select button, set the GACT_RELVERIFY
(for "release verify") flag in the gadget's Activation field.  For boolean
gadgets, Intuition will send an IDCMP_GADGETUP message to the window's
UserPort when the mouse select button is released over a GACT_RELVERIFY
gadget.  The program will only receive the IDCMP_GADGETUP message if the
user still has the pointer positioned over the select box of the gadget
when the mouse select button is released.

If the user moves the mouse out of the gadget's select box before
releasing the mouse button an IDCMP_MOUSEBUTTONS event will be sent with a
code of SELECTUP.  This indicates the user's desire to not proceed with
the action.  Boolean gadgets that are GACT_RELVERIFY allow the user a
chance to cancel a selection by rolling the mouse off of the gadget before
releasing the select button.

String gadgets have a slightly different behavior, in that they remain
active after the mouse button has been released.  The gadget remains
active until Return or Enter is pressed, the user tabs to the next or
previous gadget, another window becomes active or the user chooses another
object with the mouse.  An IDCMP_GADGETUP message is only sent for
GACT_RELVERIFY string gadgets if the user ends the gadget interaction
through the Return, Enter or (if activated) one of the tab keys.

GACT_RELVERIFY proportional gadgets send IDCMP_GADGETUP events even if the
mouse button is released when the pointer is not positioned over the
select box of the gadget.

Gadgets can specify both the GACT_IMMEDIATE and GACT_RELVERIFY activation
types, in which case, the program will receive both IDCMP_GADGETDOWN and
IDCMP_GADGETUP messages.