ButtonImageGadget()
Syntax
Result = ButtonImageGadget(#Gadget, x, y, Width, Height, ImageID)Description
Create a button gadget in the current GadgetList.
If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. #Gadget will be the number returned by EventGadgetID() command.
The ImageID represents an a valid image and can be obtained by using UseImage() or ImageID() from the Image library. If ImageID is 0, then no image will be displayed.
You can add a 'mini help' to this gadget by using GadgetToolTip().
- SetGadgetState() can be used to change the current image of the gadget. A valid ImageID can be easily got with the UseImage() or ImageID() commands. If the ImageID is 0, then the image is removed from the gadget.
Example:If OpenWindow(0,0,0,120,100,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ButtonImage") And CreateGadgetList(WindowID(0)) If LoadImage(0, "map.bmp") ; change 2nd parameter to the path/filename of your image ButtonImageGadget(0,10,10,100,83,UseImage(0)) EndIf Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow EndIf
Supported OS
Windows, Linux, MacOS X