gtk.RadioAction
Prev | The gtk Class Reference | Next

## gtk.RadioAction

gtk.RadioAction — an action that can be grouped so that only one can be active (new in PyGTK 2.4)

## Synopsis

    class gtk.RadioAction(gtk.ToggleAction):
        gtk.RadioAction(name, label, tooltip, stock_id, value)
        def set_group(group)
        def get_group()
        def get_current_value()

## Ancestry

    +-- gobject.GObject
      +-- gtk.Action
        +-- gtk.ToggleAction
          +-- gtk.RadioAction

## Implemented Interfaces

`gtk.RadioAction` implements `gtk.Buildable`

## gtk.RadioAction Properties

gtk.Action Properties

gtk.ToggleAction Properties

"current-value" | Read-Write | The value property of the currently active member of the group to which this action belongs. This property is available in GTK+ 2.10 and above.
"group" | Write | Sets a new group for a radio action. This property is available in GTK+ 2.4 and above
"value" | Read-Write | The value is an arbitrary integer which can be used as a convenient way to determine which action in the group is currently active in an "activate" or "changed" signal handler. See the `get_current_value`() and the `gtk.ActionGroup.add_radio_actions`() methods for convenient ways to get and set this property. This property is available in GTK+ 2.4 and above

## gtk.RadioAction Signal Prototypes

gobject.GObject Signal Prototypes

gtk.Action Signal Prototypes

gtk.ToggleAction Signal Prototypes

"changed" | `def callback(`radioaction`, `current`, `user_param1`, `...`)`

## Description

### Note

This object is available in PyGTK 2.4 and above.

A `gtk.RadioAction` is a subclass of `gtk.ToggleAction` and similar to `gtk.RadioMenuItem`. A number of radio actions can be linked together so that only one may be active at any one time.

## Constructor

        gtk.RadioAction(name, label, tooltip, stock_id, value)

`name` : | A unique name for the action
`label` : | The label displayed in menu items and on buttons
`tooltip` : | A tooltip for this action
`stock_id` : | The stock icon to display in widgets representing this action
`value` : | A unique integer value that `get_current_value()` should return if this action is selected.
Returns : | a new `gtk.RadioAction`

### Note

This constructor is available in PyGTK 2.4 and above.

Creates a new `gtk.RadioAction` object suing the properties specified by: `name`, `label`, `tooltip`, `stock_id` and `value`. To add the action to a `gtk.ActionGroup` and set the accelerator for the action, call the `gtk.ActionGroup.add_action_with_accel()`.

## Methods

### gtk.RadioAction.set_group

        def set_group(group)

`group` : | another `gtk.RadioAction` or `None`

### Note

This method is available in PyGTK 2.4 and above.

The `set_group`() method sets the radio group for the radio action to the same group as the `gtk.RadioAction` specified by `group` i.e. the radio action joins the group.

In PyGTK 2.6.2 and above, if `group` is `None` the radio action is removed from its current group.

### gtk.RadioAction.get_group

        def get_group()

Returns : | a list containing the radio actions in the group or `None`

### Note

This method is available in PyGTK 2.4 and above.

The `get_group`() method returns a list containing the group that the radio action belongs to or `None` if the radio action is not part of a group.

### gtk.RadioAction.get_current_value

        def get_current_value()

Returns : | The value of the currently active group member

### Note

This method is available in PyGTK 2.4 and above.

The `get_current_value`() method returns the "value" property of the the currently active member of the group that the radio action belongs to.

## Signals

### The "changed" gtk.RadioAction Signal

        def callback(radioaction, current, user_param1, ...)

`radioaction` : | the radioaction that received the signal
`current` : | the currently active `gtk.RadioAction` in the group
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

### Note

This signal is available in GTK+ 2.4 and above.

The "changed" signal is emitted on every member of a radio group when the active member is changed. The signal gets emitted after the "activate" signals for the previous and current active members.

Prev | Up | Next
gtk.ProgressBar | Home | gtk.RadioButton