Trying to use bevel buttons like radio buttons.
Two of them set up as toggles
The documentation says that VALUE is gettable and settable.
I can’t make the state change to false in code, only by clicking on them twice.
I saw this years ago, and was hoping it was fixed by now.
Is it a bug or am I missing something simple?
I develop on mac but Ive not seen this work properly on mac or windows in any version I have ever used…
Mac 10.9
Xojo 2014r1 (Cocoa)
Create a new window.
Place a single bevel button (bevelButton1) and a single push button (pushbutton1)
In the action event of the push button, place
BevelButton1.Value = not BevelButton1.Value
run the project, press the push button repeatedly, and watch what happens to the bevel button.
Now that you’ve seen it work, the question is what else is going on in your code that’s causing a problem.
This code in the Action event handler of a BevelButton control set (with 3 buttons, type set to Sticky) seems to toggle as I would expect in a quick test on OS X and Windows:
For i As Integer = 0 To 2
If i <> index Then
BevelButton1(i).Value = False
End If
Next
Trust me guys: the code I am using is exactly and only the code you supplied.
If I start a new project with a window that has no other controls at all, your code works.
If I copy those buttons to my actual project, and paste the buttons onto any window (document or sheet) that has other controls on it, they stop updating properly until I add a refresh (or presumably an invalidate) into the Action event.
The buttons are therefore exactly the same.
The code is the same (it pastes with the buttons)
No other code occurs when the buttons are clicked.