Can be all radio menus be "unchecked" at the same time?

Post

Posted
Rating:
#1 (In Topic #1487)
Regular
sergioabreu is in the usergroup ‘Regular’
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
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
sergioabreu is in the usergroup ‘Regular’
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.
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 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.
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
sergioabreu is in the usergroup ‘Regular’
Thanks for the tip
No problem em doing the logic too, if the person is aware of the behavior
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
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.

Image

(Click to enlarge)


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)

Image

(Click to enlarge)


gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top
1 guest and 0 members have just viewed this.