gtkmm
3.3.20
|
This interface can be implemented by widgets which allow the user to choose a color. More...
Public Member Functions | |
virtual | ~ColorChooser () |
GtkColorChooser* | gobj () |
Provides access to the underlying C GObject. | |
const GtkColorChooser* | gobj () const |
Provides access to the underlying C GObject. | |
Gdk::RGBA | get_rgba () const |
void | set_rgba (const Gdk::RGBA& color) |
bool | get_use_alpha () const |
void | set_use_alpha (bool use_alpha=true) |
void | add_palette (Orientation orientation, int colors_per_line, const std::vector< Gdk::RGBA >& colors) |
Adds a palette to the color chooser. | |
Glib::SignalProxy1< void, const Gdk::RGBA& > | signal_color_activated () |
Glib::PropertyProxy< Gdk::RGBA > | property_rgba () |
Current color, as a GdkRGBA. | |
Glib::PropertyProxy_ReadOnly < Gdk::RGBA > | property_rgba () const |
Current color, as a GdkRGBA. | |
Glib::PropertyProxy< bool > | property_use_alpha () |
Whether alpha should be shown. | |
Glib::PropertyProxy_ReadOnly < bool > | property_use_alpha () const |
Whether alpha should be shown. | |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
Protected Member Functions | |
virtual void | on_color_activated (const Gdk::RGBA& color) |
This is a default handler for the signal signal_color_activated(). | |
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. |
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.
virtual Gtk::ColorChooser::~ColorChooser | ( | ) | [virtual] |
static void Gtk::ColorChooser::add_interface | ( | GType | gtype_implementer | ) | [static] |
void Gtk::ColorChooser::add_palette | ( | Orientation | orientation, |
int | colors_per_line, | ||
const std::vector< Gdk::RGBA >& | colors | ||
) |
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.
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. |
Gdk::RGBA Gtk::ColorChooser::get_rgba | ( | ) | const |
bool Gtk::ColorChooser::get_use_alpha | ( | ) | const |
GtkColorChooser* Gtk::ColorChooser::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface.
Reimplemented in Gtk::ColorChooserDialog.
const GtkColorChooser* Gtk::ColorChooser::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface.
Reimplemented in Gtk::ColorChooserDialog.
virtual void Gtk::ColorChooser::on_color_activated | ( | const Gdk::RGBA& | color | ) | [protected, virtual] |
This is a default handler for the signal signal_color_activated().
Current color, as a GdkRGBA.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Current color, as a GdkRGBA.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Whether alpha should be shown.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
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.
void Gtk::ColorChooser::set_rgba | ( | const Gdk::RGBA& | color | ) |
void Gtk::ColorChooser::set_use_alpha | ( | bool | use_alpha = true | ) |
Glib::SignalProxy1< void,const Gdk::RGBA& > Gtk::ColorChooser::signal_color_activated | ( | ) |
void on_my_color_activated(const Gdk::RGBA& color)
Glib::RefPtr< Gtk::ColorChooser > wrap | ( | GtkColorChooser * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
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. |