Hello
If I have a menu with 2 RADIOS, is it possible (and normal) to have a state of 2 ot these radios "unchecked" ?
What is the correct way to toggle them, Is it bad to set menu.checked = False or True directly ?
I say that because RADIO nature is to force that AT LEAST ONE and only one to be checked . Having none checked could cause problems as the design expcted to have always one of the 2 values selected...
Please correct me or explain me if it is ok
Thanks
Can be all radio menus be "unchecked" at the same time?
-
- Regular
- Posts: 117
- Joined: Tue Jul 09, 2024 9:27 am
-
- Regular
- Posts: 117
- Joined: Tue Jul 09, 2024 9:27 am
Re: Can be all radio menus be "unchecked" at the same time?
So...
Manually clicking it works. The problem is doing by code.
I have seem 2 of them checked also
It seems that the "radio functionality" has to be done by hand in Gambas?
All languages that has a radio if we set one to true (via code), all others become false.
Manually clicking it works. The problem is doing by code.
I have seem 2 of them checked also

It seems that the "radio functionality" has to be done by hand in Gambas?
All languages that has a radio if we set one to true (via code), all others become false.
- BruceSteers
- Legend
- Posts: 2145
- Joined: Thu Jul 23, 2020 5:20 pm
- Location: Isle of Wight
Re: Can be all radio menus be "unchecked" at the same time?
try QT it can be a better toolkit than GTK
RadioButton is "native" meaning it uses the underlaying toolkit, It's behaviour is all down to the toolkit.
RadioButton is "native" meaning it uses the underlaying toolkit, It's behaviour is all down to the toolkit.
-
- Regular
- Posts: 117
- Joined: Tue Jul 09, 2024 9:27 am
Re: Can be all radio menus be "unchecked" at the same time?
Thanks for the tip
No problem em doing the logic too, if the person is aware of the behavior
No problem em doing the logic too, if the person is aware of the behavior
Re: Can be all radio menus be "unchecked" at the same time?
Check attached example.
A menu with 2 radiobuttons.
Default they are unchecked.
When clicking 'Yes' it will be checked and stay checked while application is running
When clicking 'No', it will be checked and 'Yes' will be unchecked.
Works for me on qt5, gtk2 and gtk3 (menu's just look different)
Edit: Didn't read well.
By code you can set them all to checked.
They stay checked if using gtk.
When using qt5 it works correctly (at least here -> see screen)
A menu with 2 radiobuttons.
Default they are unchecked.
When clicking 'Yes' it will be checked and stay checked while application is running
When clicking 'No', it will be checked and 'Yes' will be unchecked.
Works for me on qt5, gtk2 and gtk3 (menu's just look different)
Edit: Didn't read well.
By code you can set them all to checked.
They stay checked if using gtk.
When using qt5 it works correctly (at least here -> see screen)
You do not have the required permissions to view the files attached to this post.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- Gambas3 Debian/Ubuntu repositories
- GambOS
... there is always a Catch if things go wrong!
- Dutch translation for Gambas3
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- Gambas3 Debian/Ubuntu repositories
- GambOS
... there is always a Catch if things go wrong!