NSColorWell is not showing colour panel when unchecked Bordered option inside attribute inspector?

StackOverflow https://stackoverflow.com/questions/22452310

  •  15-06-2023
  •  | 
  •  

Question

Why NSColorWell is not showing colour panel when unchecked Bordered option. I have tried with checked bordered, its working fine showing color panel as well. But when unchecked Bordered, not displaying any colour panel. Also i have connected IBaction method to colourwell also. But it is also not responding. Is there any way to make NSColorWell work without checking Bordered option??

or else, Is this the bug??

Was it helpful?

Solution

The feature you are asking is not supported.

You can achieve it by doing some tweak. Here is how you can do.

Create a transparent gradient button similar sized to the colorwell and arrange them as shown in this pic.

enter image description here

Then write an action for the button itself. User will feel that he is clicking on the colorwell.

- (IBAction)showColor:(id)sender {

    [[NSApplication sharedApplication] orderFrontColorPanel:nil];

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top