Gtk.ToggleToolButton

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.ToolButton Gtk.ToolButton Gtk.Actionable->Gtk.ToolButton Gtk.ToolItem Gtk.ToolItem Gtk.Activatable->Gtk.ToolItem Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.ToolItem Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.ToggleToolButton Gtk.ToggleToolButton Gtk.ToolButton->Gtk.ToggleToolButton Gtk.ToolItem->Gtk.ToolButton Gtk.Widget->Gtk.Container

Subclasses:

Gtk.RadioToolButton

Methods

Inherited:

Gtk.ToolButton (14), Gtk.ToolItem (28), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Activatable (6), Gtk.Actionable (5)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

class

new_from_stock (stock_id)

get_active ()

set_active (is_active)

Virtual Methods

Inherited:

Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Activatable (2), Gtk.Actionable (4)

do_toggled ()

Properties

Inherited:

Gtk.ToolButton (6), Gtk.ToolItem (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Activatable (2), Gtk.Actionable (2)

Name

Type

Flags

Short Description

active

bool

r/w/en

If the toggle button should be pressed in

Style Properties

Inherited:

Gtk.ToolButton (1), Gtk.Widget (17)

Signals

Inherited:

Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

toggled

Emitted whenever the toggle tool button changes state.

Fields

Inherited:

Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.ToolButton

r

Class Details

class Gtk.ToggleToolButton(*args, **kwargs)
Bases:

Gtk.ToolButton

Abstract:

No

Structure:

Gtk.ToggleToolButtonClass

A Gtk.ToggleToolButton is a Gtk.ToolItem that contains a toggle button.

Use Gtk.ToggleToolButton.new() to create a new Gtk.ToggleToolButton.

CSS nodes

Gtk.ToggleToolButton has a single CSS node with name togglebutton.

classmethod new()[source]
Returns:

a newly created Gtk.ToggleToolButton

Return type:

Gtk.ToolItem

Returns a new Gtk.ToggleToolButton

New in version 2.4.

classmethod new_from_stock(stock_id)[source]
Parameters:

stock_id (str) – the name of the stock item

Returns:

A new Gtk.ToggleToolButton

Return type:

Gtk.ToolItem

Creates a new Gtk.ToggleToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like Gtk.STOCK_OK and Gtk.STOCK_APPLY.

It is an error if stock_id is not a name of a stock item.

New in version 2.4.

Deprecated since version 3.10: Use Gtk.ToggleToolButton.new() instead.

get_active()[source]
Returns:

True if the toggle tool button is pressed in, False if not

Return type:

bool

Queries a Gtk.ToggleToolButton and returns its current state. Returns True if the toggle button is pressed in and False if it is raised.

New in version 2.4.

set_active(is_active)[source]
Parameters:

is_active (bool) – whether self should be active

Sets the status of the toggle tool button. Set to True if you want the Gtk.ToggleButton to be “pressed in”, and False to raise it. This action causes the toggled signal to be emitted.

New in version 2.4.

do_toggled() virtual

Signal Details

Gtk.ToggleToolButton.signals.toggled(toggle_tool_button)
Signal Name:

toggled

Flags:

RUN_FIRST

Parameters:

toggle_tool_button (Gtk.ToggleToolButton) – The object which received the signal

Emitted whenever the toggle tool button changes state.

Property Details

Gtk.ToggleToolButton.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If the toggle tool button should be pressed in.

New in version 2.8.