BevelButton background color?

Greetings Xojo folks -

In 2019R3.2, there is a specific caution in the LR about BevelButton background color. It says that background color is only available on Windows and linux.

Fast forward, now, to 2023R3.1. There is no such warning. But the 2019R3.2 project being finished in 2023R3.1 (not ported to the current API) will not show a bevelbutton background color in MacOS Monterey Intel.

Fortunately, there is a small color change between on and off in toggle mode. It is minimally adequate but I would really like more contrast on Mac, Am I just stuck with no bevelbutton background color?

Thanks - Jim Wagner

Have you set the HasBackgroundColor to True?

The current BevelButton only changes background colors on Windows. This drop-in replacement is cross-platform: GitHub - npalardy/BevelButtonReplacement: A replacement for the now deprecated Xojo bevel button

For Ivan -

Thanks for asking. Yes, HasBackgroundColor is set. And, just to be sure, I set HasBackgroundColor before specifying the color, I use the &crrggbb forrnat for color, just like shown in the LR - have used that for years and I don.t think there is an error in the color value.

Just to be certain, I have just double-checked. In a bevelbutton action event (that IS called) I have

if me.value then

me.HasBackgroundColor = true
me.BackgroundColor = &c00ff00
Else
me.HasBackgroundColor = false
end if

Again, thanks
Jim

For Christian -

Thanks, Christian. I am ashamed to admit it, but for as long as I have been using this system (since RealBasic 0.9) I have never used 3rd party code! I have no idea what to do with Norman’s code.

Jim

Download and extract the zip from github, then open the BevelButtonReplacement.xojo_project file in Xojo.

You can run the project to see it as a demo, but when you’re ready to use the component in your own project, select the BevelButtonReplacement canvas item and the SemanticColors module from the project contents list and copy them to the clipboard. Switch to your project and paste them into the project. Then you can drag the BevelButtonReplacement into one of your windows like any other control.

From there, it’s just a matter of copying and pasting your properties and event code from the Xojo bevelbutton into the equivalents in Norman’s replacement.

Thank you so much, Christian

Jim