SelectColor issue on Yosemite

On Yosemite I am no longer able to use the ColorPicker on the SelectColor window as before. It seems to be broken.

Can anyone confirm?

Test on Yosemite:

  1. Click Button “Select Color”
  2. Click on the color picker pipet near the cancel button
  3. Note: You cannot pick a color
  4. Click Button OK
  5. Note: The Colors Window is closing and now only the color picker appears

I think this is due Xojo running the panel a modal dialog. You should better run it asynchronously.

Well, you could use NSColorPanelMBS class as replacement.

and I see the problem here, too.

Did you report a feedback case?

Thanks Christian, I did not report it yet, just wanted to have it confirmed before.

I can also confirm this :frowning:

Strange: I can use it, but it makes no difference if I select it before. The target icon can be moved and set anyway.
But when I have clicked on it and select “OK”, the magnification lens that should have been visible while picking a color appears then until I click somewhere else again.

Confirmed. This is an ugly bug.

Glad I have not gone to Yosemite yet.

I use the eyedropper tool of the color picker a lot! I hope this is fixed for R3!

  • Karen

I also have issues with progressbar and with comboboxes. I still have to document it …

what kind of issues on the comboboxes??

Are you using a NSColorWell? behind it?

So I just tested it in Shine, which uses a NSColorWell and so far everything seems to work as expected. If needs be, I can potentially rip out my NSColorWell and post it. It may take me a few days as I’m working towards a deadline.

I’ll be back on my computer only later today.

For the combos I use declares to adjust background color and the color no longer completely fills the whole text input area.

Plus the focus ring is now at a weird distance around the combo.

I need to get back to my office in order to be able to document it.

Sam, I personally would very much appreciate it if you did post your method for displaying the Color Wheel (with a functioning pipette) :wink:

I’ll see what I can do.

The following code uses the NSControl from the MacOSLib, I’ve just added a subclass of it to handle the NSColorWell (which solved a lot of issues in our apps).

Thanks Sam.
I have a question though: Your example has an NSColorWell Control on the window, which needs to be clicked in order to present the color wheel window. How do I modify it, so that a normal toolbar button causes the color wheel window to open?


Thanks Sam, I will use this. very nice :slight_smile:

I’ve been trying to replicate SelectColor with declares but showing the NSColorPanel with runModalForWindow or beginModalSessionForWindow has the same pipet bug. Maybe this isn’t supposed to be used modally anymore, or I’m not doing the modal properly which is very possible.

The SelectColor pipet does work in Carbon apps. Also SelectColor shows Cancel and OK buttons which I’ve read come with using the Carbon functions PickColor and NPickColor. Not sure how else to add those buttons.

Anyways, I like the continuous feed of non-modal so gave up replicating SelectColor. Instead, for those situations where there is no widget/ColorWell I made an interface that receives color changes and a class to show and hide the NSColorPanel singleton. This is a first draft, unfinished, bugs?. please feel free to modify, fix, refactor. Maybe Sam has another elegant solution like NSColorWell.

Thats the kicker, I used a custom control in the past and tried to wedgie it into the NSColorPanel, what I found was that’s possible to have more than one delegate, so changing the color in the TextArea (which it links to it automatically if the user clicks into a TextArea) would also change the color within my custom control.

The only way I found to use the NSColorPanel and have it behave correctly was to use a NSColorWell. You can attach a NSColorWell to the toolbar, if you see the last edition of the xDev magazine I included an article on Yosemite tricks, one of these is to move standard controls to the toolbar so that they show up in the window titlebar.

Maybe @Joe Ranieri can shed some light on how Xojo does it and we can figure out something from there.

Don’t be surprised if this is a bug in Yosemite, there’s more than plenty in this release. It seems Apple is rushing it’s software nowadays and that’s a bad place for Apple to be in!

I’m almost certain it is.

I’m posting a slightly altered version of my internal notes from the case requesting alpha channels be added to SelectColor.

[quote]Xoxo calls the legacy GetColor function, which is modal and operates in RGBColors. Unfortunately this means it has no alpha channel support.

NSColorPicker does have a public API for setting an accessory view and can be ran modal. To get the titlebar appearance as shown in the Carbon picker, various aspects of the panel were tweaked, which is most likely not allowed. Also, when using the accessory view, the buttons are not added at the bottom of the panel, but slightly above the row of ‘favorite’ colors.

NSColorPicker also has the unfortunate behavior in that it sends the changeColor: message to the window’s first responder. This means that even when the picker is running modal, colors in other parts of the program can change.

Needless to say, this yielded less than satisfactory results.[/quote]