GtkColorChooser questions



Hi all,

I am trying to use the GtkColorChooserDialog (3.14 under CentOS7 and also 3.18 under MacOS/MacPorts) and have two questions:
(1) My app will potentially do a substantial amount of custom color 
creation. Every time I make a new custom color with GtkColorChooserDialog, 
the next time I open the dialog to make another custom color, my previous 
custom color gets added as a new color swatch to the right of the custom 
color button at the bottom of the dialog. This ultimately leads to a LOT 
of unwanted color swatches in the dialog. It gets even worse as it seems 
that these custom colors are remembered when I exit the program and 
restart. I do NOT want to see every custom color I have created since the 
beginning of time appear as its own swatch in this custom color display! 
How do I disable this behavior so that I NEVER see new custom color 
swatches displayed in the dialog? I have tried calling 
gtk_color_chooser_add_palette() but that seems to only get rid of the 
row/column standard swatch display, while leaving all the unwanted custom 
color swatches in place. I have found that 'gsettings reset 
org.gtk.Settings.ColorChooser custom-colors' will clear the custom color 
swatches between program runs, but (i) that's a solution beyond the 
expertise of many of my users, and (ii) I want this unwanted swatch 
proliferation within each program execution to stop as well.
(2) Running the GtkColorChooserDialog via gtk_dialog_run() seems to always 
result in a two-step operation for the user. First, a palette of swatches 
is displayed. Then, if the user clicks the custom button (or asks to 
customize an existing color), the HSV color field tool displays and can be 
used to create a new color. I find the whole palette swatch display step a 
waste of time -- what I really want to do is to go straight to the HSV 
color field selector after first initializing the color field, via program 
subroutine call and not user GUI activity, to an initial arbitrary RGB 
setting. Is there a way to do this?
I have only tried the GtkColorChooserDialog so far, and not the 
GtkColorButton or GtkColorChooserWidget, as I saw nothing in their 
documentation that hinted I would get better results by using either of 
them directly instead of the GtkColorChooserDialog. If I'm mistaken please 
advise! (All things being equal I'd prefer using the dialog for 
programmatic convenience.)
Any suggestions (other than write my own color chooser, which I fear may 
be my ultimate fate)?
Roger Davis
Univ. of Hawaii



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]