Push button text color

In OSX Big Sur some Finder push buttons have colors, like a red ‘Delete’.
Seems there is no such feature yet in Xojo like Window.Pushbutton.Captioncolor, correct?

This is called a destructive button.

Last time I checked it only worked for alerts, and is not supported by native Xojo.

I have created a subclass that fakes this look and is available as part of my App Kit.

Ok, thanks. Was wondering.
Will remember your app kit.

I am happy that Apple have created a “style” for destuctive actions; but I think it would be better if you could use it more places.

Maybe this year, they’ll add it as a regular button style for the PushButton.

I do wiah also that it simple to fake; but alas took more work thanI expected.

1 Like

What about green as Positive actions ?

In my db projects, I use green background for navigation and red background for write operations (delete, modify, add…).

Hello, I am creating my button class as a canvas

https://www.dropbox.com/s/m6q6y4brd9zyjfy/my-Button-test.xojo_binary_project?dl=1

10 days ago I do not knew Big Sur implemented red and green text in buttons !

It looks strange to my eyes, but they are here.

Nota: my buttons are Canvas based and only one color (all is Green or Red / not text in red or green and PushButton in black).

iOS has this. MobileButton CaptionColor can be assigned to a ColorGroup so it works well in Dark Mode.

I heard such demand (at an Apple Developer Event) from developers nearly 40 years ago… was rejected then.

You mean UIKit has this option? In that case if you develop a Catalyst application, you may have access to it on the macOS (providing Apple have supported it). The trouble is, while Catalyst supports a large portion of UIKit, it doesn’t natively support a large portion of the macOS toolbox (AppKit).

The developers that I communicate with who use Catalyst, have to write a lot of bridge code for their apps to make them feel like Native macOS applications.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.