Overlay
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
- Constructors:
Overlay(**properties)
new() -> Gtk.Widget
Constructors
Methods
- class Overlay
- add_overlay(widget: Widget) None
Adds
widget
tooverlay
.The widget will be stacked on top of the main widget added with
set_child
.The position at which
widget
is placed is determined from itshalign
andvalign
properties.- Parameters:
widget – a
GtkWidget
to be added to the container
- get_clip_overlay(widget: Widget) bool
Gets whether
widget
should be clipped within the parent.- Parameters:
widget – an overlay child of
GtkOverlay
- get_measure_overlay(widget: Widget) bool
Gets whether
widget
’s size is included in the measurement ofoverlay
.- Parameters:
widget – an overlay child of
GtkOverlay
- remove_overlay(widget: Widget) None
Removes an overlay that was added with
add_overlay()
.- Parameters:
widget – a
GtkWidget
to be removed
- set_child(child: Widget | None = None) None
Sets the child widget of
overlay
.- Parameters:
child – the child widget
- set_clip_overlay(widget: Widget, clip_overlay: bool) None
Sets whether
widget
should be clipped within the parent.- Parameters:
widget – an overlay child of
GtkOverlay
clip_overlay – whether the child should be clipped
- set_measure_overlay(widget: Widget, measure: bool) None
Sets whether
widget
is included in the measured size ofoverlay
.The overlay will request the size of the largest child that has this property set to
True
. Children who are not included may be drawn outside ofoverlay
’s allocation if they are too large.- Parameters:
widget – an overlay child of
GtkOverlay
measure – whether the child should be measured
Properties
Signals
- class Overlay.signals
- get_child_position(widget: Widget) tuple[bool, Rectangle]
Emitted to determine the position and size of any overlay child widgets.
A handler for this signal should fill
allocation
with the desired position and size forwidget
, relative to the ‘main’ child ofoverlay
.The default handler for this signal uses the
widget
’s halign and valign properties to determine the position and gives the widget its natural size (except that an alignment ofFILL
will cause the overlay to be full-width/height). If the main child is aGtkScrolledWindow
, the overlays are placed relative to its contents.- Parameters:
widget – the child widget to position