PopoverBin#

Added in version 4.22.

class PopoverBin(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

A single child container with a popover.

You should use GtkPopoverBin whenever you need to present a 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.

Constructors#

class PopoverBin
classmethod new() Widget#

Creates a new popover bin widget.

Added in version 4.22.

Methods#

class PopoverBin
get_child() Widget | None#

Retrieves the child widget of the popover bin.

Added in version 4.22.

get_handle_input() bool#
get_menu_model() MenuModel | None#

Retrieves the menu model set using set_menu_model.

Added in version 4.22.

get_popover() Popover | None#

Retrieves the GtkPopover set using set_popover.

Added in version 4.22.

popdown() None#

Hides the popover from the user.

See: popup

Added in version 4.22.

popup() None#

Presents the popover to the user.

Use set_popover or set_menu_model to define the popover.

See: popdown

Added in version 4.22.

set_child(child: Widget | None = None) None#

Sets the child of the popover bin.

Added in version 4.22.

Parameters:

child – the child of the popover bin

set_handle_input(handle_input: bool) None#

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.

Added in version 4.22.

Parameters:

handle_input – whether to handle input

set_menu_model(model: MenuModel | None = None) None#

Sets the menu model used to create the popover that will be presented when calling popup.

If model is NULL, the popover will be unset.

A Popover will be created from the menu model with new_from_model. Actions will be connected as documented for this function.

If popover is already set, it will be dissociated from the popover bin, and the property is set to NULL.

See: set_popover

Added in version 4.22.

Parameters:

model – a menu model

set_popover(popover: Popover | None = None) None#

Sets the GtkPopover that will be presented when calling popup.

If popover is NULL, the popover will be unset.

If menu_model is set before calling this function, then the menu model property will be unset.

See: set_menu_model

Added in version 4.22.

Parameters:

popover – a GtkPopover

Properties#

class PopoverBin
props.child: Widget#

The type of the None singleton.

Added in version 4.22.

props.handle_input: bool#

The type of the None singleton.

Added in version 4.22.

props.menu_model: MenuModel#

The type of the None singleton.

Added in version 4.22.

props.popover: Popover#

The type of the None singleton.

Added in version 4.22.