# IupGLButton

Definition: | include pGUI.e Ihandle ih = IupGLButton(nullable_string title=NULL, [[nullable_string action=NULL,] cbfunc func=NULL,] string attributes="", dword_seq args={})
Description: | Creates an embedded OpenGL interface element that is a button. When selected, this element activates a function in the application. Its visual presentation can contain a text and/or an image. It inherits from IupGLLabel. It exists only inside an IupGLCanvasBox. title: Text to be shown to the user. It can be NULL. It will set the TITLE attribute. action: Name of the action generated when the button is selected. It can be NULL. func: a callback address, usually specified as Icallback("name"). For more information on the attributes and args parameters see IupSetAttributes. This is a paranormalised function. Returns: the identifier of the created element.
pwa/p2js: | Not supported.
See Also: | IupImage, IupGLToggle, IupGLLabel, IupButton
Notes: | The difference between a IupGLButton and a IupGLLabel is the border (controlled by IupGLSubCanvas attributes BORDERWIDTH and BORDERCOLOR), the change in background color for state feedback (controlled by PRESSCOLOR and HLCOLOR attributes), and the callback to notify the application. The natural size if the same as a IupGLLabel plus BORDERWIDTH.
Attributes: | The IupGLButton element handles all attributes defined for the IupGLLabel control, and consequently for the IupGLSubCanvas control too.
BACKIMAGE | (non inheritable) image name to be used as background. It will be zoomed to fill the background (it does not includes the border). Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.
BACKIMAGEHIGHLIGHT | (non inheritable) background image name of the element in highlight state. If it is not defined then the BACKIMAGE is used.
BACKIMAGEINACTIVE | (non inheritable) background image name of the element when inactive. If it is not defined then the BACKIMAGE is used and its colors will be replaced by a modified version creating the disabled effect.
BACKIMAGEPRESS | (non inheritable) background image name of the element in pressed state. If it is not defined then the BACKIMAGE is used.
FGCOLOR | Text color. Can have an alpha component. Default: "0 0 0". If TITLE and IMAGE are both not defined then the button will show a color in a rectangle using this attribute (since 3.15).
FRONTIMAGE | (non inheritable) image name to be used as foreground. It will be zoomed to fill the foreground (it does not includes the border). The foreground has the same are as the background, but it is drawn at last. Use IupSetHandle or IupSetAttributeHandle to associate an image to a name. See also IupImage.
FITTOBACKIMAGE | (non inheritable) enable the natural size to be computed from the BACKIMAGE. If BACKIMAGE is not defined will be ignored. When set to Yes it will set BORDERWIDTH to 0. Can be Yes or No. Default: No.
FRONTIMAGEHIGHLIGHT | (non inheritable) foreground image name of the element in highlight state. If it is not defined then the FRONTIMAGE is used.
FRONTIMAGEINACTIVE | (non inheritable) foreground image name of the element when inactive. If it is not defined then the FRONTIMAGE is used and its colors will be replaced by a modified version creating the disabled effect.
FRONTIMAGEPRESS | (non inheritable) foreground image name of the element in pressed state. If it is not defined then the FRONTIMAGE is used.
Callbacks | The IupGLButton element handles all callbacks defined for the IupGLSubCanvas control.
ACTION | Action generated when the button 1 (usually left) is selected. This callback is called only after the mouse is released and when it is released inside the button area. function action_cb(Ihandle ih) ih: identifier of the element that activated the event. Returns: IUP_CLOSE will be processed.