shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
179 stars 19 forks source link

Radio points element visual misbehave #433

Closed dredknight closed 5 years ago

dredknight commented 5 years ago

Shoes build: 3.3.7 - 3302 All radio points in the cluster are shown as pressed. Functional wise it is working properly when clicked. Visually they are always all pressed.

image

ccoupe commented 5 years ago

Shoes 3.3.7 chnage radio and tightened the rules. There is no default for a Radio cluster (group). On Gtk it is often is the first radio but that can not be assumed, particularly for OSX. The rules for radios that are not in a group is that they have a 'hidden' group of one radio (so it is often on) and can't be unset by the user. If you think about it deeply, that makes sense - In a group, there is always one that has to be set. You would want checkbox for that situation.

I can't tell how your radio's are grouped. You might want to make sure the group name is a symbol - :symbol.

dredknight commented 5 years ago

@ccoupe those radios were made quite some versions behind (3.3.2 ~3.3.3) so I assume the code should be reiterated to follow the new rules. I will check and let you know.

ccoupe commented 5 years ago

The rule should be "a group name" is required for radio buttons". I thought about enforcing that but it's not backwards compatible. Then again the old system was broken. It just happened to work for some people, some of the time.

dredknight commented 5 years ago

I tried the following error but it breaks the stack. did I do something wrong?

Shoes.app do

radio(group: "one", left: 10, top: 10)
radio(group: "one", left: 10, top: 30)
radio(group: "one", left: 10, top: 50)
radio(group: "one", left: 10, top: 70)

end

image

dredknight commented 5 years ago

My bad the syntax is wrong. This one works:

Shoes.app do

radio(:one, left: 10, top: 10)
radio(:one, left: 10, top: 30)
radio(:one, left: 10, top: 50)
radio(:one, left: 10, top: 70)

end

I will do some changes to the manual description.

P.S.

Made a mess... incidentally pushed to the master instead of the fork. I do reverted the change though. Sorry.

The change is pushed in pull request.