ButtonGadget with Icons

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

ButtonGadget with Icons

Post by va!n »

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
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hi,

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
Regards
Wolf
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

SetGadgetText is not supported on ButtonImageGadget according to the manual. Wonder if that work.
Tranquil
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Tranquil wrote:SetGadgetText is not supported on ButtonImageGadget according to the manual. Wonder if that work.
SetGadgetText works on all Gadgets, but the text is not always visible :wink:
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.
Image
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

thx for the help... however it would be nice to have a native PB command to add icons (left, center, right) to a ButtonGadget for all OS instead using API!
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply