Color picker close

After I let the user choose a color with the color.selectedfromdialog, I’d like to automatically close the color picker window. Is there a way for that?

Use the DesktopColorPicker instead, you can close that yourself.

https://documentation.xojo.com/api/user_interface/desktop/desktopcolorpicker.html

Sounds nice. Would you have a code-example, since there is none in the documentation? Seams quite a bit different to handle than the old one. Thanks.

Drop A ColorPicker from the Tools pane (right) onto your window,
In a button.Pressed event:
ColorPicker1.Show(RGB(255,9,9), “Choose a Color”, 0,0, 230,415)

Works fine on MacOS

For example.

Thanks, it works!
Had, however, a problem that the picker would never disappear. Found out, how to delete the ‘saved state’ file. Strange.

Once you get your color change event. Try calling colorpicker1.close

It might fire the event on show, so maybe add a check to see if there has been a bit of time since showing and the color change event.

I do not understand:

This is a DesktopColorPicker, not the previous one. Check the Super.

Please, read this thread:

How do I use the DesktopColorPicker ?