GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::ColorButton Class Reference

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

#include <gfc/gtk/colorbutton.hh>

Inheritance diagram for GFC::Gtk::ColorButton:

GFC::Gtk::Button GFC::Gtk::Bin GFC::Gtk::Container GFC::Gtk::Widget GFC::Gtk::Object GFC::Atk::Implementor GFC::G::Object GFC::G::TypeInterface GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable List of all members.

Signal Prototypes

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Protected Member Functions

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

GFC::Gtk::ColorButton::ColorButton GtkColorButton *  color_button,
bool  owns_reference = false
[explicit, protected]
 

Construct a new ColorButton from an existing GtkColorButton.

Parameters:
color_button A pointer to a GtkColorButton.
owns_reference Set 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).

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

GFC::Gtk::ColorButton::ColorButton const Gdk::Color color  )  [explicit]
 

Constructs a new color button.

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


Member Function Documentation

unsigned short GFC::Gtk::ColorButton::get_alpha  )  const
 

Gets the current alpha value.

Returns:
An integer between 0 and 65535.

Gdk::Color GFC::Gtk::ColorButton::get_color  )  const
 

Gets the current color in the color button widget.

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

String GFC::Gtk::ColorButton::get_title  )  const
 

Gets the title of the color selection dialog.

Returns:
A String contining the title.

bool GFC::Gtk::ColorButton::get_use_alpha  )  const
 

Determines whether the color selection dialog uses the alpha channel.

Returns:
true if the color sample uses alpha channel, false if not.

void GFC::Gtk::ColorButton::set_alpha unsigned short  alpha  ) 
 

Sets the current opacity to be alpha.

Parameters:
alpha An integer between 0 and 65535.

void GFC::Gtk::ColorButton::set_color const Gdk::Color color  ) 
 

Sets the current color to be color.

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

void GFC::Gtk::ColorButton::set_title const String title  ) 
 

Sets the title for the color selection dialog.

Parameters:
title A String containing the new window title.

void GFC::Gtk::ColorButton::set_use_alpha bool  use_alpha  ) 
 

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

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

const ColorSetSignalProxy GFC::Gtk::ColorButton::sig_color_set  ) 
 

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

const ColorSetSignalType GFC::Gtk::ColorButton::color_set_signal [static, protected]
 

Color set signal (see sig_color_set()).

Calls a slot with the signature:

             void function();


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:38 2004 for GFC-UI by doxygen 1.3.8