Associating a Callback with a Gadget
A gadget can define several
Predefined Callback Types
-
Main—This callback type defines the callbacks that carry out the main action attached to a gadget.
-
Focus In—This callback type defines callbacks that carry out actions performed when the gadget is given the focus. The symbol corresponding to this callback type can be retrieved by FocusInSymbol. See Focus Management.
-
Focus Out—This callback type defines callbacks that carry out actions performed when the gadget loses the focus. The symbol corresponding to this callback type can be retrieved by FocusOutSymbol. See Focus Management.
-
Enter Gadget—This callback type defines callbacks that carry out actions performed when the mouse enters the gadget. The symbol corresponding to this callback type can be retrieved by EnterGadgetSymbol. See Gadget Holder Events.
-
Leave Gadget—This callback type defines callbacks that carry out actions performed when the mouse leaves the gadget. The symbol corresponding to this callback type can be retrieved by LeaveGadgetSymbol. See Gadget Holder Events.
For example, if you want to add a Focus In callback to a gadget, you can code:
gadget->addCallback(IlvGadget::FocusInSymbol(), callback);
where callback has been declared as follows:
void callback(IlvGraphic* g, IlAny arg) { ... }
In addition to these general predefined callback types, each gadget type has specific predefined callback types attached. For more details, see the sections describing the individual gadgets.