Gtk.PopoverBin

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.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.PopoverBin Gtk.PopoverBin Gtk.Widget->Gtk.PopoverBin

Subclasses:

None

Methods

Inherited:

Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (18), Gtk.Buildable (1)

Structs:

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

class

new ()

get_child ()

get_handle_input ()

get_menu_model ()

get_popover ()

popdown ()

popup ()

set_child (child)

set_handle_input (handle_input)

set_menu_model (model)

set_popover (popover)

Virtual Methods

Inherited:

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

Properties

Inherited:

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

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/en

handle-input

bool

r/w/en

menu-model

Gio.MenuModel

r/w/en

popover

Gtk.Popover

r/w/en

Signals

Inherited:

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

Fields

Inherited:

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

Class Details

class Gtk.PopoverBin(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Gtk.PopoverBinClass

A single child container with a popover.

You should use GtkPopoverBin whenever you need to present a [class`Gtk`.Popover] to the user.

Actions

GtkPopoverBin defines the menu.popup action, which can be activated to present the popover to the user.

CSS nodes

GtkPopoverBin has a single CSS node with the name popoverbin.

New in version 4.22.

classmethod new()[source]
Returns:

the newly created popover bin

Return type:

Gtk.Widget

Creates a new popover bin widget.

New in version 4.22.

get_child()[source]
Returns:

the child widget

Return type:

Gtk.Widget or None

Retrieves the child widget of the popover bin.

New in version 4.22.

get_handle_input()[source]
Return type:

bool

get_menu_model()[source]
Returns:

the menu model for the popover

Return type:

Gio.MenuModel or None

Retrieves the menu model set using [method`Gtk`.PopoverBin.set_menu_model].

New in version 4.22.

get_popover()[source]
Returns:

a popover widget

Return type:

Gtk.Popover or None

Retrieves the GtkPopover set using [method`Gtk`.PopoverBin.set_popover].

New in version 4.22.

popdown()[source]

Hides the popover from the user.

See: [method`Gtk`.PopoverBin.popup]

New in version 4.22.

popup()[source]

Presents the popover to the user.

Use [method`Gtk`.PopoverBin.set_popover] or [method`Gtk`.PopoverBin.set_menu_model] to define the popover.

See: [method`Gtk`.PopoverBin.popdown]

New in version 4.22.

set_child(child)[source]
Parameters:

child (Gtk.Widget or None) – the child of the popover bin

Sets the child of the popover bin.

New in version 4.22.

set_handle_input(handle_input)[source]
Parameters:

handle_input (bool) – whether to handle input

Enables or disables input handling.

If enabled, the popover bin will pop up the popover on right-click or long press, as expected for a context menu.

New in version 4.22.

set_menu_model(model)[source]
Parameters:

model (Gio.MenuModel or None) – a menu model

Sets the menu model used to create the popover that will be presented when calling [method`Gtk`.PopoverBin.popup].

If model is NULL, the popover will be unset.

A [class`Gtk`.Popover] will be created from the menu model with [ctor`Gtk`.PopoverMenu.new_from_model]. Actions will be connected as documented for this function.

If [property`Gtk`.PopoverBin:popover] is already set, it will be dissociated from the popover bin, and the property is set to NULL.

See: [method`Gtk`.PopoverBin.set_popover]

New in version 4.22.

set_popover(popover)[source]
Parameters:

popover (Gtk.Popover or None) – a GtkPopover

Sets the GtkPopover that will be presented when calling [method`Gtk`.PopoverBin.popup].

If popover is NULL, the popover will be unset.

If [property`Gtk`.PopoverBin:menu-model] is set before calling this function, then the menu model property will be unset.

See: [method`Gtk`.PopoverBin.set_menu_model]

New in version 4.22.

Property Details

Gtk.PopoverBin.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget of the popover bin.

New in version 4.22.

Gtk.PopoverBin.props.handle_input
Name:

handle-input

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the popover bin will handle input to trigger the popup.

New in version 4.22.

Gtk.PopoverBin.props.menu_model
Name:

menu-model

Type:

Gio.MenuModel

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The GMenuModel from which the popup will be created.

See [method`Gtk`.PopoverBin.set_menu_model] for the interaction with the [property`Gtk`.PopoverBin:popover] property.

New in version 4.22.

Gtk.PopoverBin.props.popover
Name:

popover

Type:

Gtk.Popover

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The GtkPopover that will be popped up when calling [method`Gtk`.PopoverBin.popup].

New in version 4.22.