GUI Help > Special > addToolbarButton
addToolbarButton
addToolbarButton [handle gadget, int index, bool isToggleButton] | [handle gadget, str fileName, bool isToggleButton], [str tooltip]
Description: Adds a button to a toolbar gadget. You can either add a standard button by specifying its index, or you can load the icon for the button from a file. You may optionally specify tooltip text which appears when the user holds their mouse over the button. isToggleButton determines whether or not the button will toggle a normal / "pushed in" state when clicked.
Return Value:
Parameters:
gadget | Hande to a toolbar gadget.
index | Index of the image to add. Specify EITHER this index OR a filename. After creating the toolbar, call addStandardToolbarButtons, and then use these values for the index from the constants file:
    TOOLBAR_CUT
    TOOLBAR_COPY
    TOOLBAR_PASTE
    TOOLBAR_UNDO
    TOOLBAR_REDO
    TOOLBAR_DELETE
    TOOLBAR_NEW
    TOOLBAR_OPEN
    TOOLBAR_SAVE
    TOOLBAR_PRINTPREVIEW
    TOOLBAR_PROPERTIES
    TOOLBAR_HELP
    TOOLBAR_FIND
    TOOLBAR_REPLACE
    TOOLBAR_PRINT
imageFile | If specified, the filename of the image to use as the icon for the new button.
isToggleButton | 0 for a normal toolbar button, or 1 for a toggle toolbar button.
[tooltip] | Optional. Text of the tooltip associated with the button. You will see this text when you hold the mouse over the button.
Remarks:
See Also:
Example: (Note: You will need to include the GUI constants file for this example to work)