Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::Button Class Reference

A GtkButton C++ wrapper class. More...

#include <inti/gtk/button.h>

Inheritance diagram for Inti::Gtk::Button:

Inti::Gtk::Bin Inti::Gtk::Container Inti::Gtk::Widget Inti::Gtk::Object Inti::Atk::Implementor Inti::G::Object Inti::G::TypeInterface Inti::G::TypeInstance Inti::MemoryHandler Inti::G::TypeInstance Inti::ReferencedBase Inti::ReferencedBase Inti::Gtk::OptionMenu Inti::Gtk::StockButton Inti::Gtk::ToggleButton Inti::Gtk::CheckButton Inti::Gtk::RadioButton List of all members.

Public Member Functions

Constructors
Accessors
Methods
Property Proxies
Signal Proxies

Protected Member Functions

Constructors
Accessors
Methods
Signal Handlers

Detailed Description

A GtkButton C++ wrapper class.

The Button widget is generally used to attach a function to that is called when the button is pressed. The Button widget can hold any valid child widget. That is it can hold most any other standard Widget. The most commonly used child is the Label.


Constructor & Destructor Documentation

Inti::Gtk::Button::Button GtkButton *  button,
bool  reference = false
[explicit, protected]
 

Construct a new Button from an existing GtkButton.

Parameters:
button A pointer to a GtkButton.
reference Set false if the initial reference count is floating, set true if it's not.

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

Inti::Gtk::Button::Button Image image  )  [explicit]
 

Constructs a Button widget that contains an Image.

Parameters:
image The Image you want the Button to contain.

Inti::Gtk::Button::Button const String label,
bool  use_underline = false
[explicit]
 

Constructs a Button widget with a Label child containing the given label.

Parameters:
label The text you want the Label to hold.
use_underline Set true if label contains a mnemonic character.

If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.

Inti::Gtk::Button::Button Image image,
const String label,
bool  use_underline = false,
bool  horizontal = false
 

Sets the image and label for the button.

Parameters:
image The Image you want the button to display.
label The text you want the button to display.
use_underline Set true if an underline in the label indicates a mnemonic.
horizontal Set true if the image and label should be beside each other.

This constructor lets you display an image and a label inside a button, like a toolbar button does. If horizontal is true the label is displayed beside the image. If horizontal is false the label is displayed underneath the image.


Member Function Documentation

String Inti::Gtk::Button::get_label  )  const
 

Fetches the text from the label of the button, as set by set_label().

Returns:
The text of the label widget.

If the label text has not been set the return value will be a null String. This will be the case if you create an empty button to use as a container.

bool Inti::Gtk::Button::get_use_stock  )  const
 

Returns whether the button label is a stock item.

Returns:
true if the button label is used to select a stock item instead of being used directly as the label text.

virtual void Inti::Gtk::Button::on_clicked  )  [protected, virtual]
 

Called when a button clicked on by the mouse and the cursor stays on the button.

If the cursor is not on the button when the mouse button is released, the signal is not emitted.

void Inti::Gtk::Button::set_depressed bool  depressed  )  [protected]
 

Sets whether the button is currently drawn as down or not.

Parameters:
depressed Set true if the button should be drawn with a recessed shadow.

This is purely a visual setting, and is meant only for use by derived widgets.

void Inti::Gtk::Button::set_image Image image,
const String label,
bool  use_underline = false,
bool  horizontal = false
 

Sets the image and label for the button.

Parameters:
image The Image you want the button to display.
label The text you want the button to display.
use_underline Set true if an underline in the label indicates a mnemonic.
horizontal Set true if the image and label should be beside each other.

This is a convenience method that lets you display an image and a label inside a button, like a toolbar button does. If horizontal is true the label is displayed beside the image. If horizontal is false the label is displayed underneath the image. This method will clear any previously set image or label.

void Inti::Gtk::Button::set_label const String label  ) 
 

Sets the text of the label of the button to label.

Parameters:
label A String.

This method will clear any previously set label. The text is also used to select the stock item if set_use_stock() is used.

void Inti::Gtk::Button::set_relief ReliefStyle  newstyle  ) 
 

Sets the relief style of the edges of the Button.

Parameters:
newstyle The ReliefStyle to set.

Three styles exist, RELIEF_NORMAL, RELIEF_HALF, RELIEF_NONE. The default style is, as one can guess, RELIEF_NORMAL.

void Inti::Gtk::Button::set_use_stock bool  use_stock  ) 
 

Sets whether the label set on the button is used as a stock id to select the stock item for the button.

Parameters:
use_stock Set true if the button should use a stock item.

void Inti::Gtk::Button::set_use_underline bool  use_underline  ) 
 

Sets whether an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.

Parameters:
use_underline Set true if an underline in the text indicates a mnemonic.

const ClickedSignalProxy Inti::Gtk::Button::sig_clicked  )  [inline]
 

Connect to the clicked_signal; emitted when a button clicked on by the mouse and the cursor stays on the button.

If the cursor is not on the button when the mouse button is released, the signal is not emitted.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:13 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002