Class: Gtk::Action

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#accel_closureGObject::Closure

Returns the accel closure for this action.

Returns:

  • (GObject::Closure)

    the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified.

#accel_group=(accel_group) ⇒ nil

Sets the Gtk::AccelGroup in which the accelerator for this action will be installed.

Parameters:

Returns:

  • (nil)

#accel_pathString

Returns the accel path for this action.

Returns:

  • (String)

    the accel path for this action, or nil if none is set. The returned string is owned by GTK+ and must not be freed or modified.

#accel_path=(accel_path) ⇒ nil

Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

Note that accel_path string will be stored in a #GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().

Parameters:

  • accel_path (String)

    the accelerator path

Returns:

  • (nil)

#action_groupGtk::ActionGroup

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

Returns:

#action_group=(action_group) ⇒ Gtk::ActionGroup

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

Parameters:

Returns:

#activatenil

Emits the “activate” signal on the specified action, if it isn’t insensitive. This gets called by the proxy widgets when they get activated.

It can also be used to manually activate an action.

Returns:

  • (nil)

#always_show_imageTrueClass

Returns whether action’s menu item proxies will always show their image, if available.

Returns:

  • (TrueClass)

    true if the menu item proxies will always show their image

#always_show_image=(always_show_image) ⇒ TrueClass

If true, the action’s menu item proxies will ignore the Gtk::Settings:gtk-menu-images setting and always show their image, if available.

Use this property if the menu item would be useless or hard to use without their image.

Parameters:

  • always_show_image (TrueClass)

Returns:

  • (TrueClass)

    always-show-image

  • (TrueClass)

    always-show-image

#always_show_image?TrueClass

If true, the action’s menu item proxies will ignore the Gtk::Settings:gtk-menu-images setting and always show their image, if available.

Use this property if the menu item would be useless or hard to use without their image.

Returns:

  • (TrueClass)

    always-show-image

#block_activatenil

Disable activation signals from the action

This is needed when updating the state of your proxy Gtk::Activatable widget could result in calling gtk_action_activate(), this is a convenience function to avoid recursing in those cases (updating toggle state for instance).

Returns:

  • (nil)

#connect_acceleratornil

Installs the accelerator for action if action has an accel path and group. See gtk_action_set_accel_path() and gtk_action_set_accel_group()

Since multiple proxies may independently trigger the installation of the accelerator, the action counts the number of times this function has been called and doesn’t remove the accelerator until gtk_action_disconnect_accelerator() has been called as many times.

Returns:

  • (nil)

#create_icon(icon_size) ⇒ Gtk::Widget

This function is intended for use by action implementations to create icons displayed in the proxy widgets.

Parameters:

  • icon_size (Integer)

    the size of the icon (Gtk::IconSize) that should be created.

Returns:

  • (Gtk::Widget)

    a widget that displays the icon for this action.

#create_menuGtk::Widget

If action provides a Gtk::Menu widget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu.

Returns:

  • (Gtk::Widget)

    the menu item provided by the action, or nil.

#create_menu_itemGtk::Widget

Creates a menu item widget that proxies for the given action.

Returns:

  • (Gtk::Widget)

    a menu item connected to the action.

#create_tool_itemGtk::Widget

Creates a toolbar item widget that proxies for the given action.

Returns:

  • (Gtk::Widget)

    a toolbar item connected to the action.

#disconnect_acceleratornil

Undoes the effect of one call to gtk_action_connect_accelerator().

Returns:

  • (nil)

#giconGio::Icon

The #GIcon displayed in the Gtk::Action.

Note that the stock icon is preferred, if the Gtk::Action:stock-id property holds the id of an existing stock icon.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Returns:

#gicon=(gicon) ⇒ Gio::Icon

The #GIcon displayed in the Gtk::Action.

Note that the stock icon is preferred, if the Gtk::Action:stock-id property holds the id of an existing stock icon.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Parameters:

Returns:

#hide_if_empty=(hide_if_empty) ⇒ TrueClass

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

Parameters:

  • hide_if_empty (TrueClass)

Returns:

  • (TrueClass)

    hide-if-empty

  • (TrueClass)

    hide-if-empty

#hide_if_empty?TrueClass

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

Returns:

  • (TrueClass)

    hide-if-empty

#icon_nameString

The name of the icon from the icon theme.

Note that the stock icon is preferred, if the Gtk::Action:stock-id property holds the id of an existing stock icon, and the #GIcon is preferred if the Gtk::Action:gicon property is set.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Returns:

  • (String)

    icon-name

#icon_name=(icon_name) ⇒ String

The name of the icon from the icon theme.

Note that the stock icon is preferred, if the Gtk::Action:stock-id property holds the id of an existing stock icon, and the #GIcon is preferred if the Gtk::Action:gicon property is set.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Parameters:

  • icon_name (String)

Returns:

  • (String)

    icon-name

  • (String)

    icon-name

#is_importantTrueClass

Checks whether action is important or not

Returns:

  • (TrueClass)

    whether action is important

#is_important=(is_important) ⇒ TrueClass

Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.

Parameters:

  • is_important (TrueClass)

Returns:

  • (TrueClass)

    is-important

  • (TrueClass)

    is-important

#is_important?TrueClass

Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.

Returns:

  • (TrueClass)

    is-important

#is_sensitiveTrueClass

Returns whether the action is effectively sensitive. are both sensitive.

Returns:

  • (TrueClass)

    true if the action and its associated action group

#is_visibleTrueClass

Returns whether the action is effectively visible. are both visible.

Returns:

  • (TrueClass)

    true if the action and its associated action group

#labelString

The label used for menu items and buttons that activate this action. If the label is nil, GTK+ uses the stock label specified via the stock-id property.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Returns:

  • (String)

    label

#label=(label) ⇒ String

The label used for menu items and buttons that activate this action. If the label is nil, GTK+ uses the stock label specified via the stock-id property.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Parameters:

  • label (String)

Returns:

  • (String)

    label

  • (String)

    label

#nameString

A unique name for the action.

Returns:

  • (String)

    name

#name=(name) ⇒ String

A unique name for the action.

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#new(name, label, tooltip, stock_id) ⇒ Gtk::Action

Creates a new Gtk::Action object. To add the action to a Gtk::ActionGroup and set the accelerator for the action, call gtk_action_group_add_action_with_accel(). See the [UI Definition section] for information on allowed action names.

Parameters:

  • name (String)

    A unique name for the action

  • label (String)

    the label displayed in menu items and on buttons, or nil

  • tooltip (String)

    a tooltip for the action, or nil

  • stock_id (String)

    the stock icon to display in widgets representing the action, or nil

Returns:

#proxiesGLib::SList

Returns the proxy widgets for an action. See also gtk_activatable_get_related_action(). and must not be modified.

Returns:

  • (GLib::SList)

    a #GSList of proxy widgets. The list is owned by GTK+

#sensitiveTrueClass

Returns whether the action itself is sensitive. Note that this doesn’t necessarily mean effective sensitivity. See gtk_action_is_sensitive() for that.

Returns:

  • (TrueClass)

    true if the action itself is sensitive.

#sensitive=(sensitive) ⇒ TrueClass

Whether the action is enabled.

Parameters:

  • sensitive (TrueClass)

Returns:

  • (TrueClass)

    sensitive

  • (TrueClass)

    sensitive

#sensitive?TrueClass

Whether the action is enabled.

Returns:

  • (TrueClass)

    sensitive

#short_labelString

A shorter label that may be used on toolbar buttons.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Returns:

  • (String)

    short-label

#short_label=(short_label) ⇒ String

A shorter label that may be used on toolbar buttons.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Parameters:

  • short_label (String)

Returns:

  • (String)

    short-label

  • (String)

    short-label

#stock_idString

The stock icon displayed in widgets representing this action.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Returns:

  • (String)

    stock-id

#stock_id=(stock_id) ⇒ String

The stock icon displayed in widgets representing this action.

This is an appearance property and thus only applies if Gtk::Activatable:use-action-appearance is true.

Parameters:

  • stock_id (String)

Returns:

  • (String)

    stock-id

  • (String)

    stock-id

#tooltipString

A tooltip for this action.

Returns:

  • (String)

    tooltip

#tooltip=(tooltip) ⇒ String

A tooltip for this action.

Parameters:

  • tooltip (String)

Returns:

  • (String)

    tooltip

  • (String)

    tooltip

#unblock_activatenil

Reenable activation signals from the action

Returns:

  • (nil)

#visibleTrueClass

Returns whether the action itself is visible. Note that this doesn’t necessarily mean effective visibility. See gtk_action_is_sensitive() for that.

Returns:

  • (TrueClass)

    true if the action itself is visible.

#visible=(visible) ⇒ TrueClass

Whether the action is visible.

Parameters:

  • visible (TrueClass)

Returns:

  • (TrueClass)

    visible

  • (TrueClass)

    visible

#visible?TrueClass

Whether the action is visible.

Returns:

  • (TrueClass)

    visible

#visible_horizontalTrueClass

Checks whether action is visible when horizontal

Returns:

  • (TrueClass)

    whether action is visible when horizontal

#visible_horizontal=(visible_horizontal) ⇒ TrueClass

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

Parameters:

  • visible_horizontal (TrueClass)

Returns:

  • (TrueClass)

    visible-horizontal

  • (TrueClass)

    visible-horizontal

#visible_horizontal?TrueClass

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

Returns:

  • (TrueClass)

    visible-horizontal

#visible_overflown=(visible_overflown) ⇒ TrueClass

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

Parameters:

  • visible_overflown (TrueClass)

Returns:

  • (TrueClass)

    visible-overflown

  • (TrueClass)

    visible-overflown

#visible_overflown?TrueClass

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

Returns:

  • (TrueClass)

    visible-overflown

#visible_verticalTrueClass

Checks whether action is visible when horizontal

Returns:

  • (TrueClass)

    whether action is visible when horizontal

#visible_vertical=(visible_vertical) ⇒ TrueClass

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

Parameters:

  • visible_vertical (TrueClass)

Returns:

  • (TrueClass)

    visible-vertical

  • (TrueClass)

    visible-vertical

#visible_vertical?TrueClass

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

Returns:

  • (TrueClass)

    visible-vertical