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…
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
[quote=78557:@Jeff Tullin]Trying to use bevel buttons like radio buttons.
Two of them set up as toggles[/quote]
Place BevelButton1 and BevelButton2. In BevelButton1 Action event :
Me.Value = True
BevelButton2.Value = False
In BevelButton2 Action event :
Me.Value = True
BevelButton1.Value = False
When you click a button it deselects the other and it remains clicked.
They start off false.
Click one and it shows value = true
Click the other and it shows true too.
Nothing seems to set the button to false.
They have to be sticky, and they don’t redraw properly
I have to issue a specific .refresh to make them look false, when on some windows.
Jeff - Nothing from either of your 2 previous posts is true from my testing on Mac and Win. Something else is clearly going on in your code.
Same toggle results as Roger, Paul, and Michel on Win7 and Win8; toggle works as expected. Perhaps an example of how you are using them?
Yes ; Jeff should post his code. That is the only way.
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.