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


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

A GtkToggleAction C++ wrapper class. More...

#include <xfc/gtk/toggleaction.hh>

Inheritance diagram for Xfc::Gtk::ToggleAction:
Xfc::Gtk::Action Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable Xfc::Gtk::RadioAction

List of all members.

Public Member Functions

Static Protected Attributes

Constructors


Detailed Description

A GtkToggleAction C++ wrapper class.

A ToggleAction corresponds roughly to a CheckMenuItem. It has an "active" state specifying whether the action has been checked or not.

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.

See also: the User Interface Manager HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::ToggleAction::ToggleAction ( GtkToggleAction *  action,
bool  owns_reference = true 
) [explicit, protected]

Construct a new ToggleAction from an existing GtkToggleAction.

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

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

Xfc::Gtk::ToggleAction::ToggleAction ( const String name,
const String label,
bool  is_active 
)

Constructs a new ToggleAction object with a reference count of 1 that the caller owns.

Parameters:
nameA unique name for the action.
labelThe label displayed in menu items and on buttons.
is_activeWhether the initial state of the toggle action is active.

To add the action to a ActionGroup and set the accelerator for the action, call Gtk::ActionGroup::add_action().

Xfc::Gtk::ToggleAction::ToggleAction ( const String name,
const StockId stock_id,
bool  is_active 
)

Constructs a new ToggleAction object.

Parameters:
nameA unique name for the action.
is_activeWhether the initial state of the toggle action is active.
stock_idThe stock icon and label to display in widgets representing the action.

To add the action to a ActionGroup and set the accelerator for the action, call Gtk::ActionGroup::add_action(). The ToggleAction is created with a reference count of 1 that the caller owns.

Xfc::Gtk::ToggleAction::ToggleAction ( const String name,
const String label,
const StockId stock_id,
bool  is_active 
)

Constructs a new ToggleAction object.

Parameters:
nameA unique name for the action.
labelThe label displayed in menu items and on buttons.
is_activeWhether the initial state of the toggle action is active.
stock_idThe stock icon to display in widgets representing the action.

To add the action to a ActionGroup and set the accelerator for the action, call Gtk::ActionGroup::add_action(). Note that label is displayed instead of the stock_id label. The ToggleAction is created with a reference count of 1 that the caller owns.


Member Function Documentation

Determines the checked state of the toggle action.

Returns:
true if the toggle action is checked.

Determines whether the action should have proxies like a radio action.

Returns:
Whether the action should have proxies like a radio action.
void Xfc::Gtk::ToggleAction::set_active ( bool  is_active)

Sets the checked state of the toggle action.

Parameters:
is_activeWhether the action should be checked or not.
void Xfc::Gtk::ToggleAction::set_draw_as_radio ( bool  draw_as_radio)

Sets whether the action should have proxies like a radio action.

Parameters:
draw_as_radioWhether the action should have proxies like a radio action.

Member Data Documentation

Toggled signal (see signal_toggled()).

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