This interface can be implemented by widgets which allow the user to choose a color. More...
Static Public Member Functions |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system.
|
Related Functions |
(Note that these are not member functions.)
|
Glib::RefPtr< Gtk::ColorChooser > | wrap (GtkColorChooser* object, bool take_copy=false) |
| A Glib::wrap() method for this object.
|
Detailed Description
This interface can be implemented by widgets which allow the user to choose a color.
Depending on the situation, colors may be allowed to have alpha (translucency). The main widgets that implement this interface are ColorChooserWidget, ColorChooserDialog and ColorChooserButton.
- Since gtkmm 3.4:
Constructor & Destructor Documentation
Gtk::ColorChooser::ColorChooser |
( |
| ) |
|
|
protected |
You should derive from this class to use it.
virtual Gtk::ColorChooser::~ColorChooser |
( |
| ) |
|
|
virtual |
Member Function Documentation
static void Gtk::ColorChooser::add_interface |
( |
GType |
gtype_implementer | ) |
|
|
static |
Adds a palette to the color chooser.
If orientation is horizontal, the colors are grouped in rows, with colors in each row. If is FALSE, the colors are grouped in columns instead.
The default color palette of ColorChooserWidget has 27 colors, organized in columns of 3 colors. The default gray palette has 9 grays in a single row.
The layout of the color chooser widget works best when the palettes have 9-10 columns.
Calling this function for the first time has the side effect of removing the default color and gray palettes from the color chooser.
- Parameters
-
orientation | ORIENTATION_HORIZONTAL if the palette should be displayed in rows, or ORIENTATION_VERTICAL for columns |
colors_per_line | The number of colors to show in each row/column. |
colors | The colors of the palette. |
- Since gtkmm 3.4:
Gdk::RGBA Gtk::ColorChooser::get_rgba |
( |
| ) |
const |
static GType Gtk::ColorChooser::get_type |
( |
| ) |
|
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Reimplemented in Gtk::ColorChooserDialog.
bool Gtk::ColorChooser::get_use_alpha |
( |
| ) |
const |
Returns whether the color chooser shows the alpha channel.
- Since gtkmm 3.4:
- Returns
true
if the color chooser uses the alpha channel, false
if not.
GtkColorChooser* Gtk::ColorChooser::gobj |
( |
| ) |
|
|
inline |
const GtkColorChooser* Gtk::ColorChooser::gobj |
( |
| ) |
const |
|
inline |
virtual void Gtk::ColorChooser::on_color_activated |
( |
const Gdk::RGBA& |
color | ) |
|
|
protectedvirtual |
Glib::PropertyProxy< Gdk::RGBA > Gtk::ColorChooser::property_rgba |
( |
| ) |
|
Current color, as a GdkRGBA.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > Gtk::ColorChooser::property_rgba |
( |
| ) |
const |
Current color, as a GdkRGBA.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy< bool > Gtk::ColorChooser::property_use_alpha |
( |
| ) |
|
Whether alpha should be shown.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gtk::ColorChooser::property_use_alpha |
( |
| ) |
const |
Whether alpha should be shown.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
- Returns
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
void Gtk::ColorChooser::set_rgba |
( |
const Gdk::RGBA& |
color | ) |
|
void Gtk::ColorChooser::set_use_alpha |
( |
bool |
use_alpha = true | ) |
|
Sets whether or not the color chooser should use the alpha channel.
- Since gtkmm 3.4:
- Parameters
-
use_alpha | true if color chooser should use alpha channel, false if not. |
Glib::SignalProxy1< void,const Gdk::RGBA& > Gtk::ColorChooser::signal_color_activated |
( |
| ) |
|
- Slot Prototype:
void on_my_color_activated(const Gdk::RGBA& color)
Emitted when a color is activated from the color chooser. This usually happens when the user clicks a color swatch, or a color is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
- Since gtkmm 3.4:
- Parameters
-
Friends And Related Function Documentation
Glib::RefPtr< Gtk::ColorChooser > wrap |
( |
GtkColorChooser * |
object, |
|
|
bool |
take_copy = false |
|
) |
| |
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
- Returns
- A C++ instance that wraps this C instance.
The documentation for this class was generated from the following file: