Synopsis#include <gtk/gtk.h> GtkColorSelection; GtkWidget* gtk_color_selection_new (void); void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel, GtkUpdateType policy); void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel, gboolean has_opacity); gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel); void gtk_color_selection_set_has_palette (GtkColorSelection *colorsel, gboolean has_palette); gboolean gtk_color_selection_get_has_palette (GtkColorSelection *colorsel); guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel); void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel, guint16 alpha); void gtk_color_selection_get_current_color (GtkColorSelection *colorsel, GdkColor *color); void gtk_color_selection_set_current_color (GtkColorSelection *colorsel, const GdkColor *color); guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel); void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel, guint16 alpha); void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel, GdkColor *color); void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel, const GdkColor *color); gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel); gboolean gtk_color_selection_palette_from_string (const gchar *str, GdkColor **colors, gint *n_colors); gchar* gtk_color_selection_palette_to_string (const GdkColor *colors, gint n_colors); GtkColorSelectionChangePaletteFunc gtk_color_selection_set_change_palette_hook (GtkColorSelectionChangePaletteFunc func); void (*GtkColorSelectionChangePaletteFunc) (const GdkColor *colors, gint n_colors); GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func); void (*GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkColor *colors, gint n_colors); void gtk_color_selection_set_color (GtkColorSelection *colorsel, gdouble *color); void gtk_color_selection_get_color (GtkColorSelection *colorsel, gdouble *color); Object HierarchyGObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GtkVBox +----GtkColorSelection Properties"current-alpha" guint : Read / Write "current-color" GdkColor* : Read / Write "has-opacity-control" gboolean : Read / Write "has-palette" gboolean : Read / Write DescriptionThe GtkColorSelection is a widget that is used to select a color. It consists of a color wheel and number of sliders and entry boxes for color parameters such as hue, saturation, value, red, green, blue, and opacity. It is found on the standard color selection dialog box GtkColorSelectionDialog. DetailsGtkColorSelectiontypedef struct _GtkColorSelection GtkColorSelection; The GtkColorSelection struct contains private data only, and should be accessed using the functions below. gtk_color_selection_new ()GtkWidget* gtk_color_selection_new (void); Creates a new GtkColorSelection.
gtk_color_selection_set_update_policy ()void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel, GtkUpdateType policy); Warning
Sets the policy controlling when the color_changed signals are emitted. The available policies are:
gtk_color_selection_set_has_opacity_control ()void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel, gboolean has_opacity);
Sets the
gtk_color_selection_get_has_opacity_control ()gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel); Determines whether the colorsel has an opacity control.
gtk_color_selection_set_has_palette ()void gtk_color_selection_set_has_palette (GtkColorSelection *colorsel, gboolean has_palette);
Shows and hides the palette based upon the value of
gtk_color_selection_get_has_palette ()gboolean gtk_color_selection_get_has_palette (GtkColorSelection *colorsel); Determines whether the color selector has a color palette.
gtk_color_selection_get_current_alpha ()guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel); Returns the current alpha value.
gtk_color_selection_set_current_alpha ()void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel, guint16 alpha);
Sets the current opacity to be
gtk_color_selection_get_current_color ()void gtk_color_selection_get_current_color (GtkColorSelection *colorsel, GdkColor *color);
Sets
gtk_color_selection_set_current_color ()void gtk_color_selection_set_current_color (GtkColorSelection *colorsel, const GdkColor *color);
Sets the current color to be
gtk_color_selection_get_previous_alpha ()guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel); Returns the previous alpha value.
gtk_color_selection_set_previous_alpha ()void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel, guint16 alpha);
Sets the 'previous' alpha to be
gtk_color_selection_get_previous_color ()void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel, GdkColor *color);
Fills
gtk_color_selection_set_previous_color ()void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel, const GdkColor *color);
Sets the 'previous' color to be
gtk_color_selection_is_adjusting ()gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
Gets the current state of the
gtk_color_selection_palette_from_string ()gboolean gtk_color_selection_palette_from_string (const gchar *str, GdkColor **colors, gint *n_colors);
Parses a color palette string; the string is a colon-separated
list of color names readable by
gtk_color_selection_palette_to_string ()gchar* gtk_color_selection_palette_to_string (const GdkColor *colors, gint n_colors); Encodes a palette as a string, useful for persistent storage.
gtk_color_selection_set_change_palette_hook ()GtkColorSelectionChangePaletteFunc gtk_color_selection_set_change_palette_hook (GtkColorSelectionChangePaletteFunc func); Warning
Installs a global function to be called whenever the user tries to modify the palette in a color selection. This function should save the new palette contents, and update the GtkSettings property "gtk-color-palette" so all GtkColorSelection widgets will be modified.
GtkColorSelectionChangePaletteFunc ()void (*GtkColorSelectionChangePaletteFunc) (const GdkColor *colors, gint n_colors);
gtk_color_selection_set_change_palette_with_screen_hook ()GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func); Installs a global function to be called whenever the user tries to modify the palette in a color selection. This function should save the new palette contents, and update the GtkSettings property "gtk-color-palette" so all GtkColorSelection widgets will be modified.
Since 2.2 GtkColorSelectionChangePaletteWithScreenFunc ()void (*GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkColor *colors, gint n_colors);
Since 2.2 gtk_color_selection_set_color ()void gtk_color_selection_set_color (GtkColorSelection *colorsel, gdouble *color); Warning
Sets the current color to be
gtk_color_selection_get_color ()void gtk_color_selection_get_color (GtkColorSelection *colorsel, gdouble *color); Warning
Sets
This function is deprecated, use
Property DetailsThe
|
|
the object which received the signal. |
|
user data set when the signal handler was connected. |