Search code examples
objective-ccocoanscolorpanel

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


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??


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];
    
    }