SelectColor issues Mac

Not really new, but only just starting to impact me, is the changes that Apple made to the Color Picker.
At some point, SelectColor stopped displaying a dialog with Cancel and OK

I understand that Xcode apps use a callback system to make ‘the thing that uses the color’ change instantly while the dialog is open.
Personally, I dislike that, but I’m a small voice in the wind.

I have a mix of Xojo versions to use, from 2028 through 2021, but I dont want to use API2

When I call SelectColor, I get a dialog that returns TRUE when I click the close gadget.
But no OK/Cancel.
This means that if someone opens the dialog and makes a change, there is no way to say ‘oops, I didnt mean to make the screen pink’ other than to try to remember the color that they started with.

And more: the style of the dialog varies from app to app… sometimes I get a tall dialog with loads of spaces for favorites at the bottom, sometimes a more squat version with barely any space there at all.

The NS version with callbacks has been available from MBS for a few years, but the sample has hard coded ‘Window1’ in the event handler and I havent managed to work out how to change this to work with some color value or some canvas control because it seems you only get one instance per app.


Is there a way to get the buttons back, keeping consistency between my Windows and Mac versions?

Does anyone have a presentable replacement color picker class? (I know Einhugur has a plugin, but unless Im mistaken, doesn’t sell individual controls)

Does anyone have an example of using the singleton method from MBS (I have those plugins), work on a multitude of controls and variables in an app , in the ‘callback’ manner?


the color picker is too cumbersome for me
That’s why I moved my color selection to the menu bar and open a with my colors there
a color selection with a mouse click takes over the color and closes the window2


Have you tried using the ColorPicker control instead? It’ll fire the events on windows and Linux for consistency.

FWIW, The way to deal with not having a cancel button is to support undo apparently.

This is new to me… must be after 2018 , so I wont have seen it as I am keeping the code compatible with Xojo 2015 on Windows.
I’ll take a look, although I really dont want to make Windows work like the Mac on this… :slight_smile:

It won’t. On windows and Linux it’s still the old behavior, but the programming interface is the same.

I have complained about that too. Apparently it has something to do with changes in macOS, so apparently it works as it should. Yes I can use the Color Picker, but it just makes it more complicated than it has to be, as it’s inconsistent with the other platforms. Personally, I would therefore prefer to keep it as it was, as what I do is complicated anyway. Any shortcuts are welcome.

Im not getting anywhere with this so far.
Really not liking the unpredictable dialog that shows up.
I feel like I may resort to writing one, but would much rather not.

GraffitiSuite has a color picker control for those it may apply.

1 Like

On what Mac OS version does SelectColor no longer have the OK and cancel buttons?

I’m on 10.14.6 and using 2019R1.1 and SelectColor is working as it always has.


The Ohanaware App Kit has a NSColorWell control that uses the… NSColorWell control. It’s a button, that when clicked will display the color picker, when a user selects a color, the colorChanged event of the control fires. It’s how Objective-C apps have done it since 2000 (probably Swift too, but I have no interest in learning Swift).

However it is macOS only, albeit I could add some code to make it fall back to Xojo functions for Windows, but I don’t have a valid Windows install so I can’t test it.

Happens on at least Catalina, Big Sur , Mojave of my machines, and reported so far by 5 customers some of whom have Monterey.
Im Using Xojo versions 2018 through 2021.
I wonder if there is some system wide setting I am missing?
I’m on 11.4

Sadly, (unless I am mistaken) you only get the chicken if you buy the farm… :slight_smile:
The suite is impressive and has things I might find a use for eventually, but …

In oder to illustrate the variation of dialogs I am seeing, I fired up a couple of my apps this morning to take screenshots, and the OK/Cancel buttons are present today.
I dont understand whats going on.

Then it’s weird that I don’t see it on Mojave!

  • Karen

It is because you probably use the ColorPicker Control, not SelectColor Method…

Has anyone tried to close the ColorPicker (or DesktopColorPicker) when closing the application and mark it “Open” in the preferences file and reopen it when running the application (if the Preference is “Open”)?

That does not exist in 2019r1.1