Gtk.RadioAction

g GObject.GInterface GObject.GInterface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.Object GObject.Object Gtk.Action Gtk.Action GObject.Object->Gtk.Action Gtk.ToggleAction Gtk.ToggleAction Gtk.Action->Gtk.ToggleAction Gtk.Buildable->Gtk.Action Gtk.RadioAction Gtk.RadioAction Gtk.ToggleAction->Gtk.RadioAction

Subclasses:

None

Methods

Inherited:

Gtk.ToggleAction (6), Gtk.Action (42), GObject.Object (37), Gtk.Buildable (10)

Structs:

GObject.ObjectClass (5)

class

new (name, label, tooltip, stock_id, value)

get_current_value ()

get_group ()

join_group (group_source)

set_current_value (current_value)

set_group (group)

Virtual Methods

Inherited:

Gtk.ToggleAction (1), Gtk.Action (6), GObject.Object (7), Gtk.Buildable (10)

do_changed (current)

Properties

Inherited:

Gtk.ToggleAction (2), Gtk.Action (16)

Name

Type

Flags

Short Description

current-value

int

r/w

The value property of the currently active member of the group to which this action belongs. deprecated

group

Gtk.RadioAction

w

The radio action whose group this action belongs to. deprecated

value

int

r/w

The value returned by Gtk.RadioAction.get_current_value() when this action is the current action of its group. deprecated

Signals

Inherited:

Gtk.ToggleAction (1), Gtk.Action (1), GObject.Object (1)

Name

Short Description

changed

The ::changed signal is emitted on every member of a radio group when the active member is changed. deprecated

Fields

Inherited:

Gtk.ToggleAction (1), Gtk.Action (1), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.ToggleAction

r

Class Details

class Gtk.RadioAction(*args, **kwargs)
Bases:

Gtk.ToggleAction

Abstract:

No

Structure:

Gtk.RadioActionClass

A Gtk.RadioAction is similar to Gtk.RadioMenuItem. A number of radio actions can be linked together so that only one may be active at any one time.

classmethod new(name, label, tooltip, stock_id, value)[source]
Parameters:
  • name (str) – A unique name for the action

  • label (str or None) – The label displayed in menu items and on buttons, or None

  • tooltip (str or None) – A tooltip for this action, or None

  • stock_id (str or None) – The stock icon to display in widgets representing this action, or None

  • value (int) – The value which Gtk.RadioAction.get_current_value() should return if this action is selected.

Returns:

a new Gtk.RadioAction

Return type:

Gtk.RadioAction

Creates a new Gtk.RadioAction object. To add the action to a Gtk.ActionGroup and set the accelerator for the action, call Gtk.ActionGroup.add_action_with_accel().

New in version 2.4.

Deprecated since version 3.10.

get_current_value()[source]
Returns:

The value of the currently active group member

Return type:

int

Obtains the value property of the currently active member of the group to which self belongs.

New in version 2.4.

Deprecated since version 3.10.

get_group()[source]
Returns:

the list representing the radio group for this object

Return type:

[Gtk.RadioAction]

Returns the list representing the radio group for this object. Note that the returned list is only valid until the next change to the group.

A common way to set up a group of radio group is the following:

GSList *group = NULL;
GtkRadioAction *action;

while ( ...more actions to add... /)
  {
     action = gtk_radio_action_new (...);

     gtk_radio_action_set_group (action, group);
     group = gtk_radio_action_get_group (action);
  }

New in version 2.4.

Deprecated since version 3.10.

join_group(group_source)[source]
Parameters:

group_source (Gtk.RadioAction or None) – a radio action object whos group we are joining, or None to remove the radio action from its group

Joins a radio action object to the group of another radio action object.

Use this in language bindings instead of the Gtk.RadioAction.get_group() and Gtk.RadioAction.set_group() methods

A common way to set up a group of radio actions is the following:

GtkRadioAction *action;
GtkRadioAction *last_action;

while ( ...more actions to add... /)
  {
     action = gtk_radio_action_new (...);

     gtk_radio_action_join_group (action, last_action);
     last_action = action;
  }

New in version 3.0.

Deprecated since version 3.10.

set_current_value(current_value)[source]
Parameters:

current_value (int) – the new value

Sets the currently active group member to the member with value property current_value.

New in version 2.10.

Deprecated since version 3.10.

set_group(group)[source]
Parameters:

group ([Gtk.RadioAction] or None) – a list representing a radio group, or None

Sets the radio group for the radio action object.

New in version 2.4.

Deprecated since version 3.10.

do_changed(current) virtual
Parameters:

current (Gtk.RadioAction) –

Signal Details

Gtk.RadioAction.signals.changed(radio_action, current)
Signal Name:

changed

Flags:

RUN_FIRST, NO_RECURSE

Parameters:
  • radio_action (Gtk.RadioAction) – The object which received the signal

  • current (Gtk.RadioAction) – the member of action's group which has just been activated

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.

New in version 2.4.

Deprecated since version 3.10.

Property Details

Gtk.RadioAction.props.current_value
Name:

current-value

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The value property of the currently active member of the group to which this action belongs.

New in version 2.10.

Deprecated since version 3.10.

Gtk.RadioAction.props.group
Name:

group

Type:

Gtk.RadioAction

Default Value:

None

Flags:

WRITABLE

Sets a new group for a radio action.

New in version 2.4.

Deprecated since version 3.10.

Gtk.RadioAction.props.value
Name:

value

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

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 Gtk.RadioAction.get_current_value() and Gtk.RadioActionEntry for convenient ways to get and set this property.

New in version 2.4.

Deprecated since version 3.10.