Gtk.ActionBar

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.ActionBar Gtk.ActionBar Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Gtk.ActionBar

Example

../_images/ActionBar.png
Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_center_widget ()

get_revealed ()

pack_end (child)

pack_start (child)

remove (child)

set_center_widget (center_widget)

set_revealed (revealed)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

revealed

bool

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.ActionBar(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

GtkActionBar is designed to present contextual actions.

An example Gtk.ActionBar

It is expected to be displayed below the content and expand horizontally to fill the area.

It allows placing children at the start or the end. In addition, it contains an internal centered box which is centered with respect to the full width of the box, even if the children at either side take up different amounts of space.

Gtk.ActionBar as Gtk.Buildable

The GtkActionBar implementation of the GtkBuildable interface supports adding children at the start or end sides by specifying “start” or “end” as the “type” attribute of a <child> element, or setting the center widget by specifying “center” value.

CSS nodes

`` actionbar ╰── revealer

╰── box

├── box.start │ ╰── [start children] ├── [center widget] ╰── box.end

╰── [end children]

``

A GtkActionBar’s CSS node is called actionbar. It contains a revealer subnode, which contains a box subnode, which contains two box subnodes at the start and end of the action bar, with start and `end style classes respectively, as well as a center node that represents the center child.

Each of the boxes contains children packed for that side.

classmethod new()[source]
Returns:

a new GtkActionBar

Return type:

Gtk.Widget

Creates a new GtkActionBar widget.

get_center_widget()[source]
Returns:

the center GtkWidget

Return type:

Gtk.Widget or None

Retrieves the center bar widget of the bar.

get_revealed()[source]
Returns:

the current value of the [property`Gtk`.ActionBar:revealed] property

Return type:

bool

Gets whether the contents of the action bar are revealed.

pack_end(child)[source]
Parameters:

child (Gtk.Widget) – the GtkWidget to be added to self

Adds child to self, packed with reference to the end of the self.

pack_start(child)[source]
Parameters:

child (Gtk.Widget) – the GtkWidget to be added to self

Adds child to self, packed with reference to the start of the self.

remove(child)[source]
Parameters:

child (Gtk.Widget) – the GtkWidget to be removed

Removes a child from self.

set_center_widget(center_widget)[source]
Parameters:

center_widget (Gtk.Widget or None) – a widget to use for the center

Sets the center widget for the GtkActionBar.

set_revealed(revealed)[source]
Parameters:

revealed (bool) – The new value of the property

Reveals or conceals the content of the action bar.

Note: this does not show or hide self in the [property`Gtk`.Widget:visible] sense, so revealing has no effect if the action bar is hidden.

Property Details

Gtk.ActionBar.props.revealed
Name:

revealed

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Controls whether the action bar shows its contents.