gtkmm 2.4: Gtk::ColorButton Class Reference

Main Page Widgets Namespaces Book

# Gtk::ColorButton Class Reference
[Widgets]

Inheritance diagram for Gtk::ColorButton:

[legend]
List of all members.

## Detailed Description

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.

## Public Member Functions
| ColorButton (const Gdk::Color& color)
| Creates a new color button with a predefined color.
| ColorButton ()
| Creates a new color button.
guint16 | get_alpha () const
| Returns the current alpha value.
Gdk::Color | get_color () const
| Returns a copy of the the current color.
Glib::ustring | get_title () const
| Gets the title of the color selection dialog.
bool | get_use_alpha () const
| Does the color selection dialog use the alpha channel?
const GtkColorButton* | gobj () const
| Provides access to the underlying C GtkObject.
GtkColorButton* | gobj ()
| Provides access to the underlying C GtkObject.
void | set_alpha (guint16 alpha)
| Sets the current opacity to be alpha .
void | set_color (const Gdk::Color& color)
| Sets the current color to be color .
void | set_title (const Glib::ustring& title)
| Sets the title for the color selection dialog.
void | set_use_alpha (bool use_alpha=true)
| Sets whether or not the color button should use the alpha channel.
Glib::SignalProxy0<void> | signal_color_set ()
virtual | ~ColorButton ()
## Related Functions
(Note that these are not member functions.)
Gtk::ColorButton* | wrap (GtkColorButton* object, bool take_copy=false)

## Constructor & Destructor Documentation

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. Since gtkmm 2.4:

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. Parameters:
  | color | A Gdk::Color to set the current color with.
Since gtkmm 2.4:

## Member Function Documentation

guint16 Gtk::ColorButton::get_alpha | ( |  | ) | const

| Returns the current alpha value. Returns: An integer between 0 and 65535. Since gtkmm 2.4:

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. Returns: A Gdk::Color representing the current internal color of the Gtk::ColorButton. Since gtkmm 2.4:

Glib::ustring Gtk::ColorButton::get_title | ( |  | ) | const

| Gets the title of the color selection dialog. Since gtkmm 2.4: Returns: The title.

bool Gtk::ColorButton::get_use_alpha | ( |  | ) | const

| Does the color selection dialog use the alpha channel? Returns: `true` if the color sample uses alpha channel, `false` if not. Since gtkmm 2.4:

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.

void Gtk::ColorButton::set_alpha | ( | guint16 | alpha | ) |

  | Sets the current opacity to be alpha . Since gtkmm 2.4: Parameters:
  | alpha | An integer between 0 and 65535.

void Gtk::ColorButton::set_color | ( | const Gdk::Color& | color | ) |

  | Sets the current color to be color . Since gtkmm 2.4: Parameters:
  | color | A Gdk::Color to set the current color with.

void Gtk::ColorButton::set_title | ( | const Glib::ustring& | title | ) |

  | Sets the title for the color selection dialog. Since gtkmm 2.4: Parameters:
  | 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. Since gtkmm 2.4: Parameters:
  | use_alpha | `true` if color button should use alpha channel, `false` if not.

Glib::SignalProxy0<void> Gtk::ColorButton::signal_color_set | ( |  | ) |

| Prototype: `void color_set()`

## Friends And Related Function Documentation

Gtk::ColorButton* wrap | ( | GtkColorButton* | object,
|  | bool | take_copy = `false`
| ) | `[related]`

  | 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:

- colorbutton.h