Bevel Button does not take a background?

May be I’m wrong with that, but neiter setting a background color “on+color” in the IDE works nor the sample code for that:

Me.HasBackgroundColor = True Me.BackgroundColor = &c110034
Simply ignores it. On a Mac with Catalina and Xojo 2019 R2 - any idea out there?

Bevel Button doesn’t do much of anything … doesn’t even support dark mode…
your best bet. craft your own from a canvas if you really need it

Please

Taken from Apple Developer/Human Interface Guidelines/Bevel Buttons

This must be valid for some years now, and I noticed it just now. Beside Dark mode, I’m working on replacing Bevel Buttons existing in my projects.

Yes - I would like to use it. I also tried Einhugurs “Picture Button”, which also lacks the color, tough it offers it. Is it allowed to ask what the field in the IDE is good for then? Any other way to get coloured background for any kind of buttons? Anyhow I would like to have it in Mac AND Windows Apps - without any need to change anything. Am I a dreamer? Any plugin?
Thanks again :wink:

make your own

or https://github.com/npalardy/BevelButtonReplacement

[quote=463427:@Detlef Kahner]Please

Taken from Apple Developer/Human Interface Guidelines/Bevel Buttons.[/quote]
A definite step back in HIG terms, IMO. Since Mavericks, it’s no longer obvious what is a button and what isn’t.

[quote=463422:@Michael Dettmer]May be I’m wrong with that, but neiter setting a background color “on+color” in the IDE works nor the sample code for that:

Me.HasBackgroundColor = True Me.BackgroundColor = &c110034
Simply ignores it. On a Mac with Catalina and Xojo 2019 R2 - any idea out there?[/quote]

This was asked before. Here is what you put in the Open event of the BevelButton.

Sub Open() dim p as new picture(me.width,me.height,32) p.graphics.ForeColor=rgb(255,0,0) p.graphics.FillRect(0,0,me.width,me.height) me.IconAlign = 1 me.Icon = p End Sub

Wow, nice trick Michel :wink:

But it kills my icon - in fact it is my icon then. So I would have to play around with the graphic functions to get my icon AND caption in front of a background?

@Norman - thanks a lot - I saw them before - but having a button with a background AND color with my Mac, Catalina and 2019R2 does not work even with your nice replacement. Btw: In Windows it runs fine …

Thanks a lot for your really valuable input, tough my problem is not yet solved … :frowning:

What you can do is something like that:

dim p as new picture(me.width,me.height,32) p.graphics.ForeColor=rgb(255,0,0) p.graphics.FillRect(0,0,me.width,me.height) p.graphics.Drawpicture(myIcon, (me.width-myIcon.width)/2, (me.Height-myIcon.Height)/2) me.IconAlign = 1 me.Icon = p

This places the icon myIcon that has been dragged in the project, in the center of the button, over the red background.

This makes my day - thanks a lot for this very useful tip, Michel :wink:

Anyhow I will have to take care about pressing, releasing, keyboard and so on - all manually. Like walking by foot instead of driving a car. OK, I could write a class. Only for having a button that works as expected and as in Windows already does. Finally it looks like a bug and I will report it. For now I will live with your snippet - we will see how this will be handled by Xojo.

Just saw: It is already in the feedback queue - case 8804. Since 2009. This isn’t true, is it? Anyone in here who reads this: Please help to “uprank” this by vote!

Gents, it’s a Cross-Platform-Development IDE. Or not?

No, it is a skeleton you pay fir, then you buy bricks from MBS, etc. and you create your application(s) with all.

For the Icon / Background, I would create a new Icon at the correct size, Paste the needed color in the background and Paste the Icon (centered) in above all (If I do not use these icons elsewhere).

Now, I do not use BevelButtons, only Canvas and we all know the reason why :wink: or :frowning: ; this depends on the point of view.

Well, in this case maybe check the bricks from @Björn Eiríksson at Einhugur.com:
https://einhugur.com/Html/PictureButton/index.html

Indeed, Björn has done a very good job with his own PictureButton.

Xojo did a lot of efforts to bring write once, compile to three platforms. The thing is, Windows is very alien to macOS. Almost everything is different. Internally, and functionally.

You will need to take a step back, and work around the very real differences of UI, to bring your own features.

Note that it would be a lot more complex if you where to develop with XCode on Mac, and Visual Studio on PC…

@Christian Schmitz : Tried it out - did not work on Mac :frowning: … wrote already to Björn.

@Michel Bujardet : You are totally right. This is the reason why I’m with Xojo. Just an unexpected effect here :slight_smile: At least a short remark in the documentation would be helpful - also because of new users which could suffer there. As I understood the complete API 2.0 was launched because of new users (like me). I understand and appreciate this approach. But doesn’t it seem rather worthless if a new user (like me) is confronted with issues like this?

Please do not misunderstand - for my oppinion Xojo is the best tool around - getting even better with Android. But having so obvious simple issues like that - for more than 10 years open? At least a bit strange, isn’t it?

Xojo is full of such idiosyncrasies that you may discover, the more you use it. But most of them have been fixed by workarounds that are usually posted in this forum. You may have noticed that people here are really helpful, and knowledgeable.

I don’t know the full story behind Bevel Button. I personally like it, and use it, but as you may have noted above, others don’t seem to like it.

Note that the fix I gave you is perfectly cross platform, and could have been used indeed to fix the issue.

I posted a note at <https://xojo.com/issue/8804>

Yes, thanks again, I posted your sulution as “answer” already yesterday - you got 100 points from me … :wink: