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

Inti::Gtk::ToggleButton Class Reference

A GtkToggleButton C++ wrapper class. More...

#include <inti/gtk/togglebutton.h>

Inheritance diagram for Inti::Gtk::ToggleButton:

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::CheckButton Inti::Gtk::RadioButton List of all members.

Public Member Functions

Constructors
Accessors
Methods
Property Proxies
Signal Proxies

Protected Member Functions

Constructors
Signal Handlers

Detailed Description

A GtkToggleButton C++ wrapper class.

A ToggleButton is a Button which will remain 'pressed-in' when clicked. Clicking again will cause the toggle button to return to it's normal state. If you create an empty toggle button it is advisable to pack a widget, (such as a Label and/or a Image), into the toggle button container (see GtkButton for more information).

The state of a ToggleButton can be set specifically using set_active(), and retrieved using get_active(). To simply switch the state of a toggle button, use toggled.


Constructor & Destructor Documentation

Inti::Gtk::ToggleButton::ToggleButton GtkToggleButton *  toggle_button,
bool  reference = false
[explicit, protected]
 

Construct a new ToggleButton from an existing GtkToggleButton.

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

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

Inti::Gtk::ToggleButton::ToggleButton  ) 
 

Constructs a new toggle button.

A widget should be packed into the button, such as a Label and/or Image.

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

Constructs a new toggle button with a text 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.


Member Function Documentation

bool Inti::Gtk::ToggleButton::get_active  )  const
 

Queries the toggle button and returns it's current state.

Returns:
true if the toggle button is pressed in and false if it is raised.

bool Inti::Gtk::ToggleButton::get_inconsistent  )  const
 

Gets the value set by set_inconsistent().

Returns:
true if the button is displayed as inconsistent, false otherwise.

bool Inti::Gtk::ToggleButton::get_mode  )  const
 

Retrieves whether the button is displayed as a separate indicator and label (see set_mode()).

Returns:
true if the togglebutton is drawn as a separate indicator and label.

void Inti::Gtk::ToggleButton::set_active bool  is_active  ) 
 

Sets the status of the toggle button.

Parameters:
is_active Either true or false.

Set is_active true if you want the toggle button to be 'pressed in', and false to raise it. This action causes the toggled signal to be emitted.

void Inti::Gtk::ToggleButton::set_inconsistent bool  setting  ) 
 

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a toggle button, and the current values in that range are inconsistent, you may want to display the toggle in an "in between" state.

Parameters:
setting true if the state is inconsistent.

This method turns on "in between" display. Normally you would turn off the inconsistent state again if the user toggles the toggle button. This has to be done manually, set_inconsistent() only affects visual appearance, it doesn't affect the semantics of the button.

void Inti::Gtk::ToggleButton::set_mode bool  draw_indicator  ) 
 

Sets whether the button is displayed as a separate indicator and label.

Parameters:
draw_indicator If true, draw the button as a separate indicator and label; if false, draw the button like a normal button.

You can call this method on a checkbutton or a radiobutton with draw_indicator set to false to make the button look like a normal button. This method only effects instances of classes like CheckButton and RadioButton that< derive from ToggleButton, not instances of ToggleButton itself.


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


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