![]() |
![]() |
![]() |
GIMP Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
GimpColorButton; GtkWidget * gimp_color_button_new (const gchar *title
,gint width
,gint height
,const GimpRGB *color
,GimpColorAreaType type
); void gimp_color_button_set_color (GimpColorButton *button
,const GimpRGB *color
); void gimp_color_button_get_color (GimpColorButton *button
,GimpRGB *color
); void gimp_color_button_set_update (GimpColorButton *button
,gboolean continuous
); gboolean gimp_color_button_get_update (GimpColorButton *button
); gboolean gimp_color_button_has_alpha (GimpColorButton *button
); void gimp_color_button_set_type (GimpColorButton *button
,GimpColorAreaType type
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkButton +----GimpButton +----GimpColorButton
GimpColorButton implements AtkImplementorIface, GtkBuildable and GtkActivatable.
"area-height" gint : Write / Construct "area-width" gint : Write / Construct "color" GimpRGB* : Read / Write / Construct "continuous-update" gboolean : Read / Write / Construct "title" gchar* : Read / Write / Construct Only "type" GimpColorAreaType : Read / Write / Construct
This widget provides a simple button with a preview showing the color.
On click a color selection dialog is opened. Additionally the button supports Drag and Drop and has a right-click menu that allows to choose the color from the current FG or BG color. If the user changes the color, the "color-changed" signal is emitted.
GtkWidget * gimp_color_button_new (const gchar *title
,gint width
,gint height
,const GimpRGB *color
,GimpColorAreaType type
);
Creates a new GimpColorButton widget.
This returns a button with a preview showing the color. When the button is clicked a GtkColorSelectionDialog is opened. If the user changes the color the new color is written into the array that was used to pass the initial color and the "color-changed" signal is emitted.
|
String that will be used as title for the color_selector. |
|
Width of the colorpreview in pixels. |
|
Height of the colorpreview in pixels. |
|
A pointer to a GimpRGB color. |
|
The type of transparency to be displayed. |
Returns : |
Pointer to the new GimpColorButton widget. |
void gimp_color_button_set_color (GimpColorButton *button
,const GimpRGB *color
);
Sets the button
to the given color
.
|
Pointer to a GimpColorButton. |
|
Pointer to the new GimpRGB color. |
void gimp_color_button_get_color (GimpColorButton *button
,GimpRGB *color
);
Retrieves the currently set color from the button
.
|
Pointer to a GimpColorButton. |
|
Pointer to a GimpRGB struct used to return the color. |
void gimp_color_button_set_update (GimpColorButton *button
,gboolean continuous
);
When set to TRUE, the button
will emit the "color-changed"
continuously while the color is changed in the color selection
dialog.
|
A GimpColorButton widget. |
|
The new setting of the continuous_update property. |
gboolean gimp_color_button_get_update (GimpColorButton *button
);
Returns the color button's continuous_update
property.
|
A GimpColorButton widget. |
Returns : |
the continuous_update property. |
gboolean gimp_color_button_has_alpha (GimpColorButton *button
);
Checks whether the buttons
shows transparency information.
|
Pointer to a GimpColorButton. |
Returns : |
TRUE if the button shows transparency information, FALSE
otherwise. |
void gimp_color_button_set_type (GimpColorButton *button
,GimpColorAreaType type
);
Sets the button
to the given type
. See also gimp_color_area_set_type()
.
|
Pointer to a GimpColorButton. |
|
the new GimpColorAreaType |
"area-height"
property "area-height" gint : Write / Construct
The minimum height of the button's GimpColorArea.
Allowed values: >= 1
Default value: 16
Since GIMP 2.8
"area-width"
property "area-width" gint : Write / Construct
The minimum width of the button's GimpColorArea.
Allowed values: >= 1
Default value: 16
Since GIMP 2.8
"color"
property"color" GimpRGB* : Read / Write / Construct
The color displayed in the button's color area.
Since GIMP 2.4
"continuous-update"
property "continuous-update" gboolean : Read / Write / Construct
The update policy of the color button.
Default value: FALSE
Since GIMP 2.4
"title"
property "title" gchar* : Read / Write / Construct Only
The title to be used for the color selection dialog.
Default value: NULL
Since GIMP 2.4
"type"
property"type" GimpColorAreaType : Read / Write / Construct
The type of the button's color area.
Default value: GIMP_COLOR_AREA_FLAT
Since GIMP 2.4
"color-changed"
signalvoid user_function (GimpColorButton *gimpcolorbutton,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |