Next: , Previous: GtkAction, Up: Top


75 GtkToggleAction

An action which can be toggled between two states

75.1 Overview

A <gtk-toggle-action> corresponds roughly to a <gtk-check-menu-item>. It has an "active" state specifying whether the action has been checked or not.

75.2 Usage

— Class: <gtk-toggle-action>

Derives from <gtk-action>.

This class defines the following slots:

draw-as-radio
Whether the proxies for this action look like radio action proxies
active
If the toggle action should be active in or not
— Signal on <gtk-toggle-action>: toggled
— Function: gtk-toggle-action-new (name mchars) (label mchars) (tooltip mchars) (stock_id mchars) ⇒  (ret <gtk-toggle-action>)

Creates a new <gtk-toggle-action> object. To add the action to a <gtk-action-group> and set the accelerator for the action, call gtk-action-group-add-action-with-accel.

name
A unique name for the action
label
The label displayed in menu items and on buttons
tooltip
A tooltip for the action
stock-id
The stock icon to display in widgets representing the action
ret
a new <gtk-toggle-action>

Since 2.4

— Function: gtk-toggle-action-toggled (self <gtk-toggle-action>)
— Method: toggled

Emits the "toggled" signal on the toggle action.

action
the action object

Since 2.4

— Function: gtk-toggle-action-set-active (self <gtk-toggle-action>) (is_active bool)
— Method: set-active

Sets the checked state on the toggle action.

action
the action object
is-active
whether the action should be checked or not

Since 2.4

— Function: gtk-toggle-action-get-active (self <gtk-toggle-action>) ⇒  (ret bool)
— Method: get-active

Returns the checked state of the toggle action.

action
the action object
ret
the checked state of the toggle action

Since 2.4

— Function: gtk-toggle-action-set-draw-as-radio (self <gtk-toggle-action>) (draw_as_radio bool)
— Method: set-draw-as-radio

Sets whether the action should have proxies like a radio action.

action
the action object
draw-as-radio
whether the action should have proxies like a radio action

Since 2.4

— Function: gtk-toggle-action-get-draw-as-radio (self <gtk-toggle-action>) ⇒  (ret bool)
— Method: get-draw-as-radio

Returns whether the action should have proxies like a radio action.

action
the action object
ret
whether the action should have proxies like a radio action.

Since 2.4