Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::RadioMenuItem Class Reference

A GtkRadioMenuItem C++ wrapper class. More...

`#include <xfc/gtk/radiomenuitem.hh>`

Inheritance diagram for Xfc::Gtk::RadioMenuItem:

List of all members.

## Signal Prototypes

- const GroupChangedSignalType group_changed_signal
    Group changed signal (see signal_group_changed()).

## Public Types

- typedef GSList Group
    The radio menu item group.

## Public Member Functions

Constructors

- RadioMenuItem ()
    Construct a new radio menu item.
- RadioMenuItem (const RadioMenuItem *group)
    Construct a new radio menu item.
- RadioMenuItem (const RadioMenuItem *group, const String &label, bool use_underline=false)
    Constructs a new radio menu item that is a member of group.
- virtual ~RadioMenuItem ()
    Destructor.

Accessors

- GtkRadioMenuItem * gtk_radio_menu_item () const
    Get a pointer to the GtkRadioMenuItem structure.
- operator GtkRadioMenuItem * () const
    Conversion operator; safely converts a RadioMenuItem to a GtkRadioMenuItem pointer.
- Group * get_group () const
    Returns the group to which the radio menu item belongs.

Methods

- void set_group (Group *group)
    Sets the group of a radio menu item, or changes it.

Signal Proxies

- const GroupChangedSignalProxy signal_group_changed ()
    Connect to the group_changed_signal; emitted when the group of radio menu items that a radio menu item belongs to changes.

## Protected Member Functions

Constructors

- RadioMenuItem (GtkRadioMenuItem *radio_menu_item, bool owns_reference=false)
    Construct a new RadioMenuItem from an existing GtkRadioMenuItem.

## Detailed Description

A GtkRadioMenuItem C++ wrapper class.

A radio menu item is a check menu item that belongs to a group. At each instant exactly one of the radio menu items from a group is selected. You create a group radio menu items the same way you would create a group of buttons (see Gtk::RadioButton).

Radio menu items are constructed with one of the following constructors:

        RadioMenuItem(const RadioMenuItem *group, const char *label, bool use_underline = false);
        RadioMenuItem(const RadioMenuItem *group, const String& label, bool use_underline = false);

The group argument is a pointer to an existing RadioMenuItem that already has a group assigned to it. The first radio menu item in a group is constructed by passing null as the group argument. Then subsequent menu items are constructed by passing an existing menu item as the group argument, usually the last one constructed.

        Gtk::RadioMenuItem *menu_item = 0;
        menu_item = new Gtk::RadioMenuItem(menu_item, "Item1");
        menu->append(*menu_Rangeitem, item1_slot);
        menu_item->show();

        menu_item = new Gtk::RadioMenuItem(menu_item, "Item2");
        menu->append(*menu_item, item2_slot);
        menu_item->show();

        menu_item = new Gtk::RadioMenuItem(menu_item, "Item3");
        menu->append(*menu_item, item3_slot);
        menu_item->show();

To remove a RadioMenuItem from one group and make it part of a new one, use set_group().

See also: the MenuItem and Menu HOWTOs and example.

## Constructor & Destructor Documentation

Xfc::Gtk::RadioMenuItem::RadioMenuItem | ( | GtkRadioMenuItem * | radio_menu_item,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new RadioMenuItem from an existing GtkRadioMenuItem.

Parameters:

  | radio_menu_item | A pointer to a GtkRadioMenuItem.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

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

Xfc::Gtk::RadioMenuItem::RadioMenuItem | ( | const RadioMenuItem * | group | ) | `[explicit]`

Construct a new radio menu item.

Parameters:

  | group | An exisitng radio menu item.

Xfc::Gtk::RadioMenuItem::RadioMenuItem | ( | const RadioMenuItem * | group,
|  | const String & | label,
|  | bool | use_underline = `false`
| ) |

Constructs a new radio menu item that is a member of group.

Parameters:

  | group | An exisitng radio menu item, or null to start a new group.
  | label | The text for the label
  | use_underline | Set true if label contains a mnemonic character.

## Member Function Documentation

void Xfc::Gtk::RadioMenuItem::set_group | ( | Group * | group | ) |

Sets the group of a radio menu item, or changes it.

Parameters:

  | group | The new group.

const GroupChangedSignalProxy Xfc::Gtk::RadioMenuItem::signal_group_changed | ( |  | ) |

Connect to the group_changed_signal; emitted when the group of radio menu items that a radio menu item belongs to changes.

This can be when a radio menu item switches from being alone to being part of a group of 2 or more menu items, or vice-versa, and when a button is moved from one group of 2 or more menu items to a different one, but not when the composition of the group that a menu item belongs to changes.

## Member Data Documentation

const GroupChangedSignalType Xfc::Gtk::RadioMenuItem::group_changed_signal `[static, protected]`

Group changed signal (see signal_group_changed()).

Calls a slot with the signature:

                 void function();

The documentation for this class was generated from the following file:

- radiomenuitem.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3