GtkColorSelection

Name

GtkColorSelection -- a widget used to select a color.

Synopsis


#include <gtk/gtk.h>


struct      GtkColorSelection;
GtkWidget*  gtk_color_selection_new         (void);
void        gtk_color_selection_set_update_policy
                                            (GtkColorSelection *colorsel,
                                             GtkUpdateType policy);
void        gtk_color_selection_set_use_opacity
                                            (GtkColorSelection *colorsel,
                                             gboolean use_opacity);
gboolean    gtk_color_selection_get_use_opacity
                                            (GtkColorSelection *colorsel);
void        gtk_color_selection_set_use_palette
                                            (GtkColorSelection *colorsel,
                                             gboolean use_palette);
gboolean    gtk_color_selection_get_use_palette
                                            (GtkColorSelection *colorsel);
void        gtk_color_selection_set_color   (GtkColorSelection *colorsel,
                                             gdouble *color);
void        gtk_color_selection_get_color   (GtkColorSelection *colorsel,
                                             gdouble *color);
void        gtk_color_selection_set_old_color
                                            (GtkColorSelection *colorsel,
                                             gdouble *color);
void        gtk_color_selection_get_old_color
                                            (GtkColorSelection *colorsel,
                                             gdouble *color);
void        gtk_color_selection_set_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y,
                                             gdouble *color);
gboolean    gtk_color_selection_get_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y,
                                             gdouble *color);
void        gtk_color_selection_unset_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y);
gboolean    gtk_color_selection_is_adjusting
                                            (GtkColorSelection *colorsel);

Object Hierarchy


  GtkObject
   +----GtkWidget
         +----GtkContainer
               +----GtkBox
                     +----GtkVBox
                           +----GtkColorSelection

Signal Prototypes


"color-changed"
            void        user_function      (GtkColorSelection *colorselection,
                                            gpointer user_data);

Description

The 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.

Details

struct GtkColorSelection

struct 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.

Create a new GtkColorSelection.

Returns : The new GtkColorSelection.


gtk_color_selection_set_update_policy ()

void        gtk_color_selection_set_update_policy
                                            (GtkColorSelection *colorsel,
                                             GtkUpdateType policy);

Sets the policy controlling when the color_changed signals are emitted. The available policies are:

colorsel :a GtkColorSelection.
policy :a GtkUpdateType value indicating the desired policy.


gtk_color_selection_set_use_opacity ()

void        gtk_color_selection_set_use_opacity
                                            (GtkColorSelection *colorsel,
                                             gboolean use_opacity);

Sets the colorsel to use or not use opacity.

colorsel : A GtkColorSelection.
use_opacity : TRUE if colorsel can set the opacity, FALSE otherwise.


gtk_color_selection_get_use_opacity ()

gboolean    gtk_color_selection_get_use_opacity
                                            (GtkColorSelection *colorsel);

Determines whether the colorsel can use opacity.

colorsel : A GtkColorSelection.
Returns : TRUE if the colorsel uses opacity. FALSE if it does't.


gtk_color_selection_set_use_palette ()

void        gtk_color_selection_set_use_palette
                                            (GtkColorSelection *colorsel,
                                             gboolean use_palette);

Shows and hides the palette based upon the value of use_palette.

colorsel : A GtkColorSelection.
use_palette : TRUE if palette is to be visible, FALSE otherwise.


gtk_color_selection_get_use_palette ()

gboolean    gtk_color_selection_get_use_palette
                                            (GtkColorSelection *colorsel);

Determines whether the palette is used.

colorsel : A GtkColorSelection.
Returns : TRUE if the palette is used. FALSE if it isn't.


gtk_color_selection_set_color ()

void        gtk_color_selection_set_color   (GtkColorSelection *colorsel,
                                             gdouble *color);

Sets the current color to be color. The first time this is called, it will also set the original color to be color too.

Sets the color in the GtkColorSelection. The widgets are updated to reflect the new color.

colorsel : A GtkColorSelection.
color : A color to set the current color with.


gtk_color_selection_get_color ()

void        gtk_color_selection_get_color   (GtkColorSelection *colorsel,
                                             gdouble *color);

Sets color to be the current color in the GtkColorSelection widget.

Retrieve the currently selected color value.

colorsel : A GtkColorSelection.
color : A color to fill in with the current color.


gtk_color_selection_set_old_color ()

void        gtk_color_selection_set_old_color
                                            (GtkColorSelection *colorsel,
                                             gdouble *color);

colorsel : 
color : 


gtk_color_selection_get_old_color ()

void        gtk_color_selection_get_old_color
                                            (GtkColorSelection *colorsel,
                                             gdouble *color);

Fills color in with the original color value.

colorsel : A GtkColorSelection.
color : A color to fill in with the original color value.


gtk_color_selection_set_palette_color ()

void        gtk_color_selection_set_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y,
                                             gdouble *color);

Set the palette located at (x, y) to have color set as its color.

colorsel : A GtkColorSelection.
x : The x coordinate of the palette.
y : The y coordinate of the palette.
color : A color to set the palette with.


gtk_color_selection_get_palette_color ()

gboolean    gtk_color_selection_get_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y,
                                             gdouble *color);

Set color to have the color found in the palette located at (x, y). If the palette is unset, it will leave the color unset.

colorsel : A GtkColorSelection.
x : The x coordinate of the palette.
y : The y coordinate of the palette.
color : A color to fill in with the color value.
Returns : TRUE if the palette located at (x, y) has a color set. FALSE if it doesn't.


gtk_color_selection_unset_palette_color ()

void        gtk_color_selection_unset_palette_color
                                            (GtkColorSelection *colorsel,
                                             gint x,
                                             gint y);

Change the palette located at (x, y) to have no color set.

colorsel : A GtkColorSelection.
x : The x coordinate of the palette.
y : The y coordinate of the palette.


gtk_color_selection_is_adjusting ()

gboolean    gtk_color_selection_is_adjusting
                                            (GtkColorSelection *colorsel);

Gets the current state of the colorsel.

colorsel : A GtkColorSelection.
Returns : TRUE if the user is currently dragging a color around, and FALSE if the selection has stopped.

Signals

The "color-changed" signal

void        user_function                  (GtkColorSelection *colorselection,
                                            gpointer user_data);

This signal is emitted when the color changes in the GtkColorSelection according to its update policy.

colorselection :the object which received the signal.
user_data :user data set when the signal handler was connected.