As far as i know their is no PB command to add an Icon to an ButtonGadget!
It would be really great, if this (nice looking) feature would be added to add #LEFT from the text an icon !
If its still implented, please let me know how to do it with PB, thx
ButtonGadget with Icons
ButtonGadget with Icons
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
- Hroudtwolf
- Addict
- Posts: 803
- Joined: Sat Feb 12, 2005 3:35 am
- Location: Germany(Hessen)
- Contact:
Hi,
Try this....
Regards
Wolf
Try this....
Code: Select all
Define.i idWindow = OpenWindow ( #PB_Any , #PB_Ignore , #PB_Ignore , 300 , 50 , "Button" , #PB_Window_ScreenCentered | #PB_Window_SystemMenu )
Define.i idButton1 = ButtonImageGadget ( #PB_Any , 0 , 0 , 150 , 50 , LoadIcon_( #Null , #IDI_HAND ) , #BS_TEXT | #BS_LEFT )
Define.i idButton2 = ButtonImageGadget ( #PB_Any , 150 , 0 , 150 , 50 , LoadIcon_( #Null , #IDI_WARNING ) , #BS_TEXT | #BS_LEFT )
SetGadgetText ( idButton1 , "Hello" )
SetGadgetText ( idButton2 , "World" )
Repeat
Select WaitWindowEvent ()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
Wolf
SetGadgetText works on all Gadgets, but the text is not always visibleTranquil wrote:SetGadgetText is not supported on ButtonImageGadget according to the manual. Wonder if that work.

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
