gtkmm 3.3.16
|
A button to launch a color selection dialog. More...
Public Member Functions | |
virtual | ~ColorButton () |
GtkColorButton* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkColorButton* | gobj () const |
Provides access to the underlying C GtkObject. | |
ColorButton () | |
Creates a new color button. | |
ColorButton (const Gdk::Color& color) | |
Creates a new color button with a predefined color. | |
ColorButton (const Gdk::RGBA& rgba) | |
Creates a new color button with a predefined color. | |
void | set_color (const Gdk::Color& color) |
Sets the current color to be color. | |
void | set_alpha (guint16 alpha) |
Sets the current opacity to be alpha. | |
void | set_rgba (const Gdk::RGBA& color) |
Sets the current color to be rgba. | |
Gdk::Color | get_color () const |
Returns a copy of the the current color. | |
Gdk::RGBA | get_rgba () const |
Returns a copy of the the current color. | |
guint16 | get_alpha () const |
Returns the current alpha value. | |
void | set_use_alpha (bool use_alpha=true) |
Sets whether or not the color button should use the alpha channel. | |
bool | get_use_alpha () const |
Does the color selection dialog use the alpha channel ? | |
void | set_title (const Glib::ustring& title) |
Sets the title for the color selection dialog. | |
Glib::ustring | get_title () const |
Gets the title of the color selection dialog. | |
Glib::PropertyProxy< bool > | property_use_alpha () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < bool > | property_use_alpha () const |
Whether to give the color an alpha value. | |
Glib::PropertyProxy < Glib::ustring > | property_title () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_title () const |
The title of the color selection dialog. | |
Glib::PropertyProxy< Gdk::Color > | property_color () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < Gdk::Color > | property_color () const |
The selected color. | |
Glib::PropertyProxy< Gdk::RGBA > | property_rgba () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < Gdk::RGBA > | property_rgba () const |
The selected RGBA color. | |
Glib::PropertyProxy< guint16 > | property_alpha () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < guint16 > | property_alpha () const |
The selected opacity value (0 fully transparent, 65535 fully opaque). | |
Glib::SignalProxy0< void > | signal_color_set () |
Protected Member Functions | |
virtual void | on_color_set () |
This is a default handler for the signal signal_color_set(). | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::ColorButton* | wrap (GtkColorButton* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A button to launch a color selection dialog.
The GtkColorButton is a button which displays the currently selected color an allows to open a color selection dialog to change the color. It is suitable widget for selecting a color in a preference dialog.
The ColorButton widget looks like this:
virtual Gtk::ColorButton::~ColorButton | ( | ) | [virtual] |
Gtk::ColorButton::ColorButton | ( | ) |
Creates a new color button.
This creates a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.
Gtk::ColorButton::ColorButton | ( | const Gdk::Color& | color | ) | [explicit] |
Creates a new color button with a predefined color.
Same as Gtk::ColorButton::ColorButton(). Additionally takes a Gdk::Color and initializes the button with this color. Equivalent to calling set_color(color) after the default constructor.
color | A Gdk::Color to set the current color with. |
Gtk::ColorButton::ColorButton | ( | const Gdk::RGBA& | rgba | ) | [explicit] |
Creates a new color button with a predefined color.
Same as Gtk::ColorButton::ColorButton(). Additionally takes a Gdk::RGBA and initializes the button with this color. Equivalent to calling set_rgba(color) after the default constructor.
color | A Gdk::RGBA to set the current color with. |
guint16 Gtk::ColorButton::get_alpha | ( | ) | const |
Gdk::Color Gtk::ColorButton::get_color | ( | ) | const |
Returns a copy of the the current color.
Changes to the return value will have no effect on the Gtk::ColorButton.
Gdk::RGBA Gtk::ColorButton::get_rgba | ( | ) | const |
Returns a copy of the the current color.
Changes to the return value will have no effect on the Gtk::ColorButton.
Glib::ustring Gtk::ColorButton::get_title | ( | ) | const |
bool Gtk::ColorButton::get_use_alpha | ( | ) | const |
Does the color selection dialog use the alpha channel ?
true
if the color sample uses alpha channel, false
if not. const GtkColorButton* Gtk::ColorButton::gobj | ( | ) | const [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Button.
GtkColorButton* Gtk::ColorButton::gobj | ( | ) | [inline] |
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Button.
virtual void Gtk::ColorButton::on_color_set | ( | ) | [protected, virtual] |
This is a default handler for the signal signal_color_set().
Glib::PropertyProxy_ReadOnly< guint16 > Gtk::ColorButton::property_alpha | ( | ) | const |
The selected opacity value (0 fully transparent, 65535 fully opaque).
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< guint16 > Gtk::ColorButton::property_alpha | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Gdk::Color > Gtk::ColorButton::property_color | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Gdk::Color > Gtk::ColorButton::property_color | ( | ) | const |
The selected color.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Gdk::RGBA > Gtk::ColorButton::property_rgba | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Gdk::RGBA > Gtk::ColorButton::property_rgba | ( | ) | const |
The selected RGBA color.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::ustring > Gtk::ColorButton::property_title | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::ColorButton::property_title | ( | ) | const |
The title of the color selection dialog.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< bool > Gtk::ColorButton::property_use_alpha | ( | ) | const |
Whether to give the color an alpha value.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< bool > Gtk::ColorButton::property_use_alpha | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gtk::ColorButton::set_alpha | ( | guint16 | alpha | ) |
Sets the current opacity to be alpha.
alpha | An integer between 0 and 65535. |
void Gtk::ColorButton::set_color | ( | const Gdk::Color& | color | ) |
Sets the current color to be color.
Deprecated: Use set_rgba() instead.
color | A Gdk::Color to set the current color with. |
void Gtk::ColorButton::set_rgba | ( | const Gdk::RGBA& | color | ) |
Sets the current color to be rgba.
rgba | A Gdk::RGBA to set the current color with. |
void Gtk::ColorButton::set_title | ( | const Glib::ustring & | title | ) |
Sets the title for the color selection dialog.
title | String containing new window title. |
void Gtk::ColorButton::set_use_alpha | ( | bool | use_alpha = true | ) |
Sets whether or not the color button should use the alpha channel.
use_alpha | true if color button should use alpha channel, false if not. |
Glib::SignalProxy0< void > Gtk::ColorButton::signal_color_set | ( | ) |
void on_my_color_set()
The signal_color_set() signal is emitted when the user selects a color. When handling this signal, use Gtk::ColorButton::get_color() and Gtk::ColorButton::get_alpha() (or Gtk::ColorButton::get_rgba()) to find out which color was just selected.
Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify::color signal.
Gtk::ColorButton* wrap | ( | GtkColorButton * | 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. |