Segment Editor: reduce the number of mouse clicks to set basic colour for segment

Hello, James.
My username is purely alphanumeric; besides that, the file is exactly where I said: C:/Users/[username]/.slicerrc.py.
thinking
working
OK, I have found the cause of the error message.
I had inserted the following into the start-up script file (on the last three lines):

# Always use the “Basic” color picker
# https://discourse.slicer.org/t/segment-editor-reduce-the-number-of-mouse-clicks-to-set-basic-colour-for-segment/20236/3
ctk.ctkColorDialog().setDefaultTab(0)

If you inspect the comment “Always use the Basic color picker” [copied from this thread] carefully you’ll see that proper quotation marks are used. This is causing the error.
When I change the comment to “Always use the "Basic" color picker” the error goes away.

I don’t think the curved quotation marks are especially exotic symbols, and most of all I didn’t expect any issue to be caused because they are in a comment, not a command.
Nevertheless I leave it to your judgement as to whether this is a bug or whether it is expected/intended behaviour.

I can also confirm that the command is run at start-up, as the Basic tab is indeed now shown as the default tab in the Select Color dialogue box.
Every little bit helps. :slight_smile:

***

Personally I would prefer that after clicking OK in the Select Color dialogue box I didn’t have to then also click Select in the Slicer dialogue box, but I think that the current structure of having two dialogue boxes makes the twofold confirmation unavoidable. That was part of the rationale behind my proposal to unify the current two dialogue boxes (with 1 + 2 tabs) into a single dialogue box (with 3 tabs): just a single “OK” would be needed.
I realise that may not be a huge priority, but the idea is there to be considered anyway.

—DIV