Erstellen  Editieren  FrontPage  Index  Suchen  Veränderungen  Verlauf  RSS  Login

Gtk::ColorButton

class Gtk::ColorButton

The Gtk::ColorButton 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.

<URL:http://developer.gnome.org/doc/API/2.0/gtk/color-button.png>

Class Methods

Gtk::ColorButton.new(color = nil)
Creates a new color button. This returns 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 2.4
  • color: A Gdk::Color to set the current color with.
  • Returns: a new color button.

Instance Methods

color
Gets the current color. Since 2.4
color=(color)
Sets the current color. Since 2.4
set_color(color)
Same as Gtk::ColorButton#color=. Since 2.4
alpha
Gets the current opacity value (0 fully transparent, 65535 fully opaque). Since 2.4
  • Returns: The current opacity value (0 fully transparent, 65535 fully opaque)
alpha=(alpha)
Sets the current opacity value (0 fully transparent, 65535 fully opaque). Since 2.4
  • alpha: The current opacity value (0 fully transparent, 65535 fully opaque)
  • Returns: alpha
set_alpha(alpha)
Same as Gtk::ColorButton#alpha=. Since 2.4
  • alpha: The current opacity value (0 fully transparent, 65535 fully opaque)
  • Returns: self
use_alpha?
Does the color selection dialog use the alpha channel? Since 2.4
  • Returns: true if color button should use alpha channel, false if not.
use_alpha=(use_alpha)
Sets whether or not the color button uses the alpha channel. Since 2.4
  • use_alpha: true if color button should use alpha channel, false if not.
  • Returns: use_alpha
set_use_alpha(use_alpha)
Same as Gtk::ColorButton#use_alpha=. Since 2.4
  • use_alpha: true if color button should use alpha channel, false if not.
  • Returns: self
title
Gets the title of the color selection dialog. Since 2.4
  • Returns: The title of the color selection dialog
title=(title)
Sets the title for the color selection dialog. Since 2.4
  • title: The title of the color selection dialog
  • Returns: title
set_title(title)
Same as Gtk::ColorButton#title=. Since 2.4
  • title: The title of the color selection dialog
  • Returns: self

Properties

alpha: Integer (Read/Write)
The selected opacity value (0 fully transparent, 65535 fully opaque) Since 2.4
  • Allowed values: <= 65535
  • Default value: 65535
color: Gdk::Color (Read/Write)
The selected color Since 2.4
title: String (Read/Write)
The title of the color selection dialog Since 2.4
  • Default value: "Pick a Color"
use-alpha: true or false (Read/Write)
If this property is set to true, the color swatch on the button is rendered against a checkerboard background to show its opacity and the opacity slider is displayed in the color selection dialog. Since 2.4
  • Default value: false

Signals

color-set: self
The ::color-set signal is emitted when the user selects a color. When handling this signal, use Gtk::ColorButton#color and Gtk::ColorButton#alpha to find out which color was just selected. Since 2.4

ChangeLog

  • 2006-02-01 Revised. - Masao?
Zuletzt geändert:2007/02/14 01:15:57
Stichworte:
Referenzen:[Gtk::ColorButton] [Gtk::FontButton]