Trouble selecting a color with Big Sur

I have troubles, and it may be because there is no validation button in the SelectColor window.

Also, note the SelectColor window width is extremely thin at first open; once I clicked on the RGB/TSL/etc. button, it enlarge itself; but no button to validate the selected color.
No crash, the change is not validated.

I wasted time yesterday with that, until I fired my other laptop with High Sierra and remove some other bugs (once there is a bug, I usually discover plenty… and in this case, I also discovers a bug in the my feature implementation (1) ).

(1) Copy / Paste, sometimes, is a plain foe.

2021r2 / last Big Sur / M1

Don’t use SelectColor on Big Sur. Modal color selection was deprecated but Apple a long time ago and they’ve finally done something that breaks it.

To get colors, please use the new DesktopColorPicker control which allows for asynchronous color selection on macOS and continues to be synchronous on Windows and Linux (although the events still fire for consistency).

1 Like

OK, thank you Greg.

It is a 2015r1 project. My i5 laptop had troubles and I had some times to get an eye on a project / m1…

Yeah, you’re going to need to use 2021r1.1 to fix this or a bunch of declares.


Bool = Color.SelectedFromDialog(gColor_Top,"Choose a new Top color")

Same window selection color appears, no button to validate the selected color, and it crash on the above line.


:

Xojo 2021r1.1 / m1 (latest release)

Go back and read my first response… about the new control.

1 Like

Sorry Greg, but isn’t it Color.SelectedFromDialog ?

This maybe?

Thanks; I will try.

Nota 1: I do not understand that.
Nota 2: SelectColor does not know that entry; read:
https://docs.xojo.com/SelectColor

https://docs.xojo.com/DesktopColorPicker
(New in 2021r1)

Yes Paul. Thank you.

But the doc is very scarse…

I found, in “Introduction to Programming with Xojo.pdf” (downloaded on 2021-07-27):


Var myFavoriteColor As Color
If Color.SelectedFromDialog(myFavoriteColor, "Pick A Color:") Then
  // We have the user’s color now
End If

And this crashed too.

From 2021r2 Release Notes:
64539 Framework » Desktop DesktopColorPicker should no longer raise exceptions when closed.

The Color Picker is still the same (here: no OK button…)
Xojo 2021r2 / m1 / Big Sur 11.5.1.

  1. Place a DesktopColorPicker on the layout where you want to use it.

  2. Implement the ColorSelected event to know when the user has chosen a color.

  3. In your code, when you need the user to select a color, call

    DesktopColorPicker1.Show

Now, you are correct that there is no OK button. That’s how most color pickers work on macOS today. They’re this floating palette that just hangs around until the user closes it themselves.

You can help this situation by closing the color picker when the view closes ( in the close or cancel close event) by calling DesktopColorPicker.Close. Note that this is a shared method on the class and does not need to be called on an instance so it can be called from just about anywhere.

selectcolorshow

Is it known that there is a permanent connection to textarea.SelectionTextColor

example:

https://www.dropbox.com/s/j0chcjgup3sna5h/ColorPicker-composite-Textarea.xojo_binary_project?dl=1

Hi Greg,

thank you for these information.

Yes, this looks strange in my eyes.

Sorry, I forgot my rule: check in the “OS provider” applications how things are done.

But now, the question is:
in Apple’s TextEdit, when you add colors to the user list (check the screen shot below), a focus ring (in this case: a selection ring) appears, not in RudolfJ project. (I suppose ot will be the same for my projects).

ARRRGGGGHHHH: at the time I wanted to take a screen shot, there was no more Focus ring. But:

In this screen shot, I populated the “user colors palette” (my name) at the windoid bottom’s, and selected (with a simple click) the Red color. That color appears in the larger square (bottom left) that is here to say “this is the selected color”.

Last bit of information:
In Apple’s TextEdit, there is a MenuItem (Cmd-Shift-C, as usual) that allow to show / hide the Colors windoid (named Couleurs in French).

Only need: modify the page:
https://docs.xojo.com/Color.SelectedFromDialog

to reflect the latest changes and give better information.

I went there yesterday and gave up after some times.

Now, I have to implement the solution.

hello Emile

In Apple’s TextEdit, there is a MenuItem (Cmd-Shift-C, as usual) that allow to show / hide the Colors windoid (named Couleurs in French).

is OK Cmd-Shift-C
Timer: Keyboard.CommandKey + Shiftkey
examble:
https://www.dropbox.com/s/kx1gf49uzsqddut/ColorPicker-composite-Textarea-2.xojo_binary_project?dl=1

The Color Picker stays connected to the Rectangle. If you close it and open another for the TextArea… the color change will no more affect the Rectangle.

Cmd-Shift-C does not works here on your project.

Hello Emilie,

the color picker kept focus
I added Window.show to access cmd / shift c to obtain
with my old imac 5K bigsur everything works
I cannot determine how it works for you on the M1
greetings Rudolf

new Example:

https://www.dropbox.com/s/qhovru0tnp1g3ua/ColorPicker-composite-Textarea-3.xojo_binary_project?dl=1

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.