Gtk2::Action(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸŽ€ NAME πŸŽ€

Gtk2::Action β€” it's the Perl wrapper for GtkAction. that's the whole name section bestie, she's concise and she knows it πŸ’…


πŸ¦‹ HIERARCHY πŸ¦‹

okay so she's a Glib object at heart, here's the family tree:

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

πŸ’œ INTERFACES πŸ’œ

  • Gtk2::Buildable β€” yes she's buildable, she can get assembled from XML like the icon she is πŸ‘‘

🌈 CONSTRUCTOR 🌈

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

Make a brand-new action object and get it handed right back to you, no cap. But listen closely: this is the new of Glib::Object, not gtk_action_new. don't get it twisted. like this:

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). flexible and clearer?? she ate that fr fr 🫢


✨ 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

just do the thing πŸ’₯

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 πŸ“

every one of these keeps its exact type + flags, I'm not editing a single character of the receipts:

  • 'action-group' (Gtk2::ActionGroup : default undef : readable / writable / private / static-nick / static-blurb) β€” the GtkActionGroup this GtkAction is associated with, or NULL (for internal use).
  • 'always-show-image' (boolean : default false : readable / writable / construct / private / static-nick / static-blurb) β€” whether the image will always be shown.
  • 'gicon' (Glib::Object::_Unregistered::GIcon : default undef : readable / writable / private / static-nick / static-blurb) β€” the GIcon being displayed.
  • 'hide-if-empty' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” when TRUE, empty menu proxies for this action are hidden.
  • 'icon-name' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” the name of the icon from the icon theme.
  • 'is-important' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” 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 / static-nick / static-blurb) β€” the label used for menu items and buttons that activate this action.
  • 'name' (string : default undef : readable / writable / construct-only / private / static-nick / static-blurb) β€” a unique name for the action.
  • 'sensitive' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the action is enabled.
  • 'short-label' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” a shorter label that may be used on toolbar buttons.
  • 'stock-id' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” the stock icon displayed in widgets representing this action.
  • 'tooltip' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” a tooltip for this action.
  • 'visible' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the action is visible.
  • 'visible-horizontal' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the toolbar item is visible when the toolbar is in a horizontal orientation.
  • 'visible-overflown' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” when TRUE, toolitem proxies for this action are represented in the toolbar overflow menu.
  • 'visible-vertical' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the toolbar item is visible when the toolbar is in a vertical orientation.

πŸ“£ SIGNALS πŸ“£

  • activate (Gtk2::Action) β€” she yells, you listen πŸ”₯

🧚 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 (C) 2003-2011 by the gtk2-perl team.

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


and that's the whole page bestie, you're officially fluent in Gtk2::Action 🌈✨ this was generated from Gtk2::Action(3) as shipped with perl v5.42.0, dated 2025-07-25. go build something iconic with it, ily, bye πŸ’…πŸ¦‹

πŸ“¦ where this page comes from