Funny behavior with ButtonGadget :-)))

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Funny behavior with ButtonGadget :-)))

Post by Kwai chang caine »

Hello at all

I just realized that if you add "PB_Text_Right" to a ButtonGadget

Code: Select all

ButtonGadget(#Gadget_PN_BtnSearch, 332, 34, 41, 17, "Search", #PB_Text_Right)
it magically transforms into one checkbox :shock:

Image

Damn PB, he never ceases to amaze me. :lol:

Have a good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
User avatar
jacdelad
Addict
Addict
Posts: 2110
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Funny behavior with ButtonGadget :-)))

Post by jacdelad »

On Windows checkboxes and radiobuttons (=OptionGadget) are buttons too. They simply have one additional flag: BS_CHECKBOX and BS_RADIOBUTTON. I have not checked, but I guess BS_CHECKBOX is the same as #PB_Text_Right. This is no "PB magic", sorry... :cry:

Read here for more information about that and more styles/flags for buttons: https://learn.microsoft.com/en-us/windo ... ton-styles
(Try the commandlink :wink: )
Good morning, that's a nice tnetennba!

PureBasic 6.30/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/2*DX517, 164TB+82TB+28TB+2TB SSD
Raspi 400/500
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Funny behavior with ButtonGadget :-)))

Post by Kwai chang caine »

Hello JACDELAD
Aaaah !!!! It's a shame, i believe found a miracle :lol:
When we don't know, it's really surprising this behavior :shock:
i say to me : "Kcc... You really become old... You even confused them Check and Button... This time... You're really screwed. :oops:
Thank you so much for your clear explanation 8) , you cheered me up. It's neither my fault... nor Fred's.
Have a good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Nituvious
Addict
Addict
Posts: 1033
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Funny behavior with ButtonGadget :-)))

Post by Nituvious »

KCC you can do this with windows and other gadgets as well, just change the constant to be any number you want and watch for the oddities :mrgreen:
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Funny behavior with ButtonGadget :-)))

Post by Kwai chang caine »

:shock: :lol:
Hello NITUVIOUS 8)

I have discover that because i replace a gadget by another and forget to remove the old constant :oops:

Thanks for your wizard recipe !!! :wink: :D
No need to play with fire, I already have problems every day, even when I try to follow the instructions point by point. :mrgreen:
You might think that with everything that happens to me, and often only to me, I chase after the troubles, but it's more like trouble is chasing me...and it's fast...believe me. :lol:


Have a good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Post Reply