Class: Gio::SimpleAction

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

Overview

A GSimple::Action is the obvious simple implementation of the #GAction interface. This is the easiest way to create an action for purposes of adding it to a GSimple::ActionGroup.

See also Gtk::Action.

Instance Method Summary collapse

Instance Method Details

#enabled=(enabled) ⇒ TrueClass

If action is currently enabled.

If the action is disabled then calls to g_action_activate() and g_action_change_state() have no effect.

Parameters:

  • enabled (TrueClass)

Returns:

  • (TrueClass)

    enabled

  • (TrueClass)

    enabled

#enabled?TrueClass

If action is currently enabled.

If the action is disabled then calls to g_action_activate() and g_action_change_state() have no effect.

Returns:

  • (TrueClass)

    enabled

#nameString

The name of the action. This is mostly meaningful for identifying the action once it has been added to a GSimple::ActionGroup.

Returns:

  • (String)

    name

#name=(name) ⇒ String

The name of the action. This is mostly meaningful for identifying the action once it has been added to a GSimple::ActionGroup.

Parameters:

  • name (String)

Returns:

  • (String)

    name

  • (String)

    name

#new(name, parameter_type) ⇒ Gio::SimpleAction

Creates a new action.

The created action is stateless. See g_simple_action_new_stateful() to create an action that has state.

Parameters:

  • name (String)

    the name of the action

  • parameter_type (GLib::VariantType)

    the type of parameter that will be passed to handlers for the GSimple::Action::activate signal, or nil for no parameter

Returns:

#new_stateful(name, parameter_type, state) ⇒ Gio::SimpleAction

Creates a new stateful action.

All future state values must have the same GVariant::Type as the initial state.

If the state #GVariant is floating, it is consumed.

Parameters:

  • name (String)

    the name of the action

  • parameter_type (GLib::VariantType)

    the type of the parameter that will be passed to handlers for the GSimple::Action::activate signal, or nil for no parameter

  • state (GLib::Variant)

    the initial state of the action

Returns:

#parameter_typeGLib::VariantType

The type of the parameter that must be given when activating the action.

Returns:

  • (GLib::VariantType)

    parameter-type

#parameter_type=(parameter_type) ⇒ GLib::VariantType

The type of the parameter that must be given when activating the action.

Parameters:

  • parameter_type (GLib::VariantType)

Returns:

  • (GLib::VariantType)

    parameter-type

  • (GLib::VariantType)

    parameter-type

#stateGLib::Variant

The state of the action, or nil if the action is stateless.

Returns:

  • (GLib::Variant)

    state

#state=(state) ⇒ GLib::Variant

The state of the action, or nil if the action is stateless.

Parameters:

  • state (GLib::Variant)

Returns:

  • (GLib::Variant)

    state

  • (GLib::Variant)

    state

#state_hint=(state_hint) ⇒ nil

Sets the state hint for the action.

See g_action_get_state_hint() for more information about action state hints.

Parameters:

  • state_hint (GLib::Variant)

    a #GVariant representing the state hint

Returns:

  • (nil)

#state_typeGLib::VariantType

The GVariant::Type of the state that the action has, or nil if the action is stateless.

Returns:

  • (GLib::VariantType)

    state-type

#state_type=(state_type) ⇒ GLib::VariantType

The GVariant::Type of the state that the action has, or nil if the action is stateless.

Parameters:

  • state_type (GLib::VariantType)

Returns:

  • (GLib::VariantType)

    state-type

  • (GLib::VariantType)

    state-type