Gtk2::ActionGroup(3pm)

Gtk2::ActionGroup3pm

Wrapper for gtkactiongroup

Hierarchy

  Glib::Object
  +----Gtk2::ActionGroup

Interfaces

  Gtk2::Buildable

Methods

actiongroup = Gtk2::ActionGroup->new ($name)

•

$name (string)

action = $action_group->get_action ($action_name)

•

$action_name (string)

$action_group->add_action ($action)

•

$action (Gtk2::Action)

$action_group->add_action_with_accel ($action, $accelerator)

•

$action (Gtk2::Action)

•

$accelerator (string or undef)

$action_group->add_actions ($action_entries, $user_data=undef)

•

$action_entries (scalar)

•

$user_data (scalar)

$action_group->add_radio_actions ($radio_action_entries, $value, $on_change, $user_data=undef)

•

$radio_action_entries (scalar)

•

$value (integer)

•

$on_change (scalar)

•

$user_data (scalar)

Create and add a set of "Gtk2::RadioAction" actions to $action_group. For example

    $action_group->add_radio_actions
      ([ [ "Red",   undef, "_Red",   "<Control>R", "Blood", 1 ],
         [ "Green", undef, "_Green", "<Control>G", "Grass", 2 ],
         [ "Blue",  undef, "_Blue",  "<Control>B", "Sky",   3 ],
       ],
       2,    # initial, or -1 for no initial
       sub {
         my ($first_action, $selected_action, $userdata) = @_;
         print "now: ", $selected_action->get_name, "\n";
       },
       $userdata);

"radio_action_entries" is an arrayref, each element of which is either a ref to a 6-element array

    [ $name,          # string
      $stock_id,      # string, or undef
      $label,         # string, or undef to use stock label
      $accelerator,   # string key name, or undef for no accel
      $tooltip,       # string, or undef for no tooltip
      $value          # integer, for $action->set_current_value etc
    ]

or a ref to a hash of named fields similarly. A "name" is mandatory, the rest are optional. "value" defaults to 0 if absent or "undef".

    { name        => $name,
      stock_id    => $stock_id,
      label       => $label,
      accelerator => $accelerator,
      tooltip     => $tooltip,
      value       => $value }

If $on_change is not "undef" then it's a signal handler function which is connected to the "changed" signal on the first action created. See Gtk2::RadioAction for that signal.

$action_group->add_toggle_actions ($toggle_action_entries, $user_data=undef)

•

$toggle_action_entries (scalar)

•

$user_data (scalar)

list = $action_group->list_actions

string = $action_group->get_name

$action_group->remove_action ($action)

•

$action (Gtk2::Action)

boolean = $action_group->get_sensitive

$action_group->set_sensitive ($sensitive)

•

$sensitive (boolean)

$action_group->set_translate_func ($func, $data=undef)

•

$func (scalar)

•

$data (scalar)

Since: gtk+ 2.6

string = $action_group->translate_string ($string)

•

$string (string)

Since: gtk+ 2.6

$action_group->set_translation_domain ($domain)

•

$domain (string)

boolean = $action_group->get_visible

$action_group->set_visible ($sensitive)

•

$sensitive (boolean)

Properties

'name' (string : default undef : readable / writable / construct-only / private)

A name for the action group.

'sensitive' (boolean : default true : readable / writable / private)

Whether the action group is enabled.

'visible' (boolean : default true : readable / writable / private)

Whether the action group is visible.

Signals

connect-proxy (Gtk2::ActionGroup, Gtk2::Action, Gtk2::Widget)
disconnect-proxy (Gtk2::ActionGroup, Gtk2::Action, Gtk2::Widget)
post-activate (Gtk2::ActionGroup, Gtk2::Action)
pre-activate (Gtk2::ActionGroup, Gtk2::Action)

Releases

7 releases since Debian 3.1 (Sarge); the text changed 6 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 9
  7. 10

From libgtk2-perl-doc 2:1.24992-1 in Debian 10 (Buster). Parsed by carta from the page's man source.