---
name: "Gtk2::Action"
section: "3pm"
platform: "linux"
package: "libgtk2-perl-doc"
version: "2:1.24992-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::Action"
---

# Gtk2::Action(3pm)

wrapper for GtkAction

## NAME

Gtk2::Action - wrapper for GtkAction

## HIERARCHY

```
  Glib::Object
  +----Gtk2::Action
```

## INTERFACES

```
  Gtk2::Buildable
```

## CONSTRUCTOR

### action = Gtk2::Action-\>new (key=\>value,...)

Create and return a new action object.  Note that this is the `"new"` of Glib::Object, not `"gtk_action_new"`.  Eg.

```
    Gtk2::Action->new (name => 'open-foo',
                       stock_id => 'gtk-open',
                       tooltip => 'Start a foo');
```

The keyword/value style is more flexible and a little clearer than the four direct arguments of `"gtk_action_new"` (and also works better for subclasses).

## METHODS

### $action-\>set\_accel\_group ($accel\_group)

- •

  `$accel_group` (Gtk2::AccelGroup or undef)

### string = $action-\>get\_accel\_path

Since: gtk+ 2.6

### $action-\>set\_accel\_path ($accel\_path)

- •

  `$accel_path` (string)

### $action-\>activate

### boolean = $action-\>get\_always\_show\_image

Since: gtk+ 2.20

### $action-\>set\_always\_show\_image ($always\_show)

- •

  `$always_show` (boolean)

Since: gtk+ 2.20

### $action-\>block\_activate

Since: gtk+ 2.16

### $action-\>block\_activate\_from ($proxy)

- •

  `$proxy` (Gtk2::Widget)

### $action-\>connect\_accelerator

### $action-\>connect\_proxy ($proxy)

- •

  `$proxy` (Gtk2::Widget)

### widget = $action-\>create\_icon ($icon\_size)

- •

  `$icon_size` (Gtk2::IconSize)

### widget = $action-\>create\_menu

Since: gtk+ 2.12

### widget = $action-\>create\_menu\_item

### widget = $action-\>create\_tool\_item

### $action-\>disconnect\_accelerator

### $action-\>disconnect\_proxy ($proxy)

- •

  `$proxy` (Gtk2::Widget)

### string or undef = $action-\>get\_icon\_name

Since: gtk+ 2.16

### $action-\>set\_icon\_name ($icon\_name)

- •

  `$icon_name` (string or undef)

Since: gtk+ 2.16

### boolean = $action-\>get\_is\_important

Since: gtk+ 2.16

### $action-\>set\_is\_important ($is\_important)

- •

  `$is_important` (boolean)

Since: gtk+ 2.16

### boolean = $action-\>is\_sensitive

### boolean = $action-\>is\_visible

### string or undef = $action-\>get\_label

Since: gtk+ 2.16

### $action-\>set\_label ($label)

- •

  `$label` (string)

Since: gtk+ 2.16

### string = $action-\>get\_name

### list = $action-\>get\_proxies

### boolean = $action-\>get\_sensitive

### $action-\>set\_sensitive ($sensitive)

- •

  `$sensitive` (boolean)

Since: gtk+ 2.6

### string or undef = $action-\>get\_short\_label

Since: gtk+ 2.16

### $action-\>set\_short\_label ($short\_label)

- •

  `$short_label` (string)

Since: gtk+ 2.16

### string or undef = $action-\>get\_stock\_id

Since: gtk+ 2.16

### $action-\>set\_stock\_id ($stock\_id)

- •

  `$stock_id` (string or undef)

Since: gtk+ 2.16

### string or undef = $action-\>get\_tooltip

Since: gtk+ 2.16

### $action-\>set\_tooltip ($tooltip)

- •

  `$tooltip` (string or undef)

Since: gtk+ 2.16

### $action-\>unblock\_activate

Since: gtk+ 2.16

### $action-\>unblock\_activate\_from ($proxy)

- •

  `$proxy` (Gtk2::Widget)

### boolean = $action-\>get\_visible

### boolean = $action-\>get\_visible\_horizontal

Since: gtk+ 2.16

### $action-\>set\_visible\_horizontal ($visible\_horizontal)

- •

  `$visible_horizontal` (boolean)

Since: gtk+ 2.16

### $action-\>set\_visible ($visible)

- •

  `$visible` (boolean)

Since: gtk+ 2.6

### boolean = $action-\>get\_visible\_vertical

Since: gtk+ 2.16

### $action-\>set\_visible\_vertical ($visible\_vertical)

- •

  `$visible_vertical` (boolean)

Since: gtk+ 2.16

## PROPERTIES

- 'action-group' (Gtk2::ActionGroup : default undef : readable / writable / private)

  The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).

- 'always-show-image' (boolean : default false : readable / writable / construct / private)

  Whether the image will always be shown

- 'gicon' (Glib::Object::\_Unregistered::GIcon : default undef : readable / writable / private)

  The GIcon being displayed

- 'hide-if-empty' (boolean : default true : readable / writable / private)

  When TRUE, empty menu proxies for this action are hidden.

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

  The name of the icon from the icon theme

- 'is-important' (boolean : default false : readable / writable / private)

  Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK\_TOOLBAR\_BOTH\_HORIZ mode.

- 'label' (string : default undef : readable / writable / private)

  The label used for menu items and buttons that activate this action.

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

  A unique name for the action.

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

  Whether the action is enabled.

- 'short-label' (string : default undef : readable / writable / private)

  A shorter label that may be used on toolbar buttons.

- 'stock-id' (string : default undef : readable / writable / private)

  The stock icon displayed in widgets representing this action.

- 'tooltip' (string : default undef : readable / writable / private)

  A tooltip for this action.

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

  Whether the action is visible.

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

  Whether the toolbar item is visible when the toolbar is in a horizontal orientation.

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

  When TRUE, toolitem proxies for this action are represented in the toolbar overflow menu.

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

  Whether the toolbar item is visible when the toolbar is in a vertical orientation.

## SIGNALS

- **activate** (Gtk2::Action)

  ## ENUMS AND FLAGS

### enum Gtk2::IconSize

- •

  'invalid' / 'GTK\_ICON\_SIZE\_INVALID'

- •

  'menu' / 'GTK\_ICON\_SIZE\_MENU'

- •

  'small-toolbar' / 'GTK\_ICON\_SIZE\_SMALL\_TOOLBAR'

- •

  'large-toolbar' / 'GTK\_ICON\_SIZE\_LARGE\_TOOLBAR'

- •

  'button' / 'GTK\_ICON\_SIZE\_BUTTON'

- •

  'dnd' / 'GTK\_ICON\_SIZE\_DND'

- •

  'dialog' / 'GTK\_ICON\_SIZE\_DIALOG'

## SEE ALSO

Gtk2, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2 for a full notice.
