Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions | Static Protected Attributes
Xfc::Gtk::ColorButton Class Reference

A GtkColorButton C++ wrapper class. More...

#include <xfc/gtk/colorbutton.hh>

Inheritance diagram for Xfc::Gtk::ColorButton:
Xfc::Gtk::Button Xfc::Gtk::Bin Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable

List of all members.

Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkColorButton C++ wrapper class.

The ColorButton object is a button which displays the currently selected color and when clicked, opens a color selection dialog to change the color. It is a suitable widget for selecting a color in a preference dialog.


Constructor & Destructor Documentation

Xfc::Gtk::ColorButton::ColorButton ( GtkColorButton *  color_button,
bool  owns_reference = false 
) [explicit, protected]

Construct a new ColorButton from an existing GtkColorButton.

Parameters:
color_buttonA pointer to a GtkColorButton.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The color_button can be a newly created GtkColorButton or an existing GtkColorButton (see G::Object::Object).

Xfc::Gtk::ColorButton::ColorButton ( )

Constructs a new color button.

This widget is 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.

Xfc::Gtk::ColorButton::ColorButton ( const Gdk::Color color) [explicit]

Constructs a new color button.

Parameters:
colorA Gdk::Color to set the current color with.

Member Function Documentation

unsigned short Xfc::Gtk::ColorButton::get_alpha ( ) const

Gets the current alpha value.

Returns:
An integer between 0 and 65535.

Gets the current color in the color button widget.

Returns:
A Gdk::Color filled with the current color.

Gets the title of the color selection dialog.

Returns:
A String contining the title.

Determines whether the color selection dialog uses the alpha channel.

Returns:
true if the color sample uses alpha channel, false if not.
void Xfc::Gtk::ColorButton::set_alpha ( unsigned short  alpha)

Sets the current opacity to be alpha.

Parameters:
alphaAn integer between 0 and 65535.

Sets the current color to be color.

Parameters:
colorA Gdk::Color to set the current color with.
void Xfc::Gtk::ColorButton::set_title ( const String title)

Sets the title for the color selection dialog.

Parameters:
titleA String containing the new window title.
void Xfc::Gtk::ColorButton::set_use_alpha ( bool  use_alpha)

Sets whether or not the color button should use the alpha channel.

Parameters:
use_alphaSet true if the button should use the alpha channel, false if not.

Connect to the color_set_signal; emitted when the user selects a color.

When handling this signal, use get_color() and get_alpha() to find out which color was just selected.


Member Data Documentation

Color set signal (see signal_color_set()).

Calls a slot with the signature:

< void function();
<

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC