Gtk.Overlay¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10) | 
|---|---|
| Structs: | Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5) | 
| class | new() | 
| add_overlay(widget) | |
| get_overlay_pass_through(widget) | |
| reorder_overlay(child, index_) | |
| set_overlay_pass_through(widget, pass_through) | 
Virtual Methods¶
| Inherited: | Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10) | 
|---|
| do_get_child_position(widget, allocation) | 
Properties¶
| Inherited: | Gtk.Container (3), Gtk.Widget (39) | 
|---|
Child Properties¶
| Name | Type | Default | Flags | Short Description | 
|---|---|---|---|---|
| index | int | 0 | r/w | The index of the overlay in the parent, -1 for the main child | 
| pass-through | bool | False | r/w | Pass through input, does not affect main child | 
Style Properties¶
| Inherited: | Gtk.Widget (17) | 
|---|
Signals¶
| Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| get-child-position | The ::get-child-positionsignal is emitted to determine the position and size of any overlay child widgets. | 
Fields¶
| Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | Gtk.Bin | r | 
Class Details¶
- 
class Gtk.Overlay(**kwargs)¶
- Bases: - Gtk.Bin- Abstract: - No - Structure: - Gtk.OverlayClass- Gtk.Overlayis a container which contains a single main child, on top of which it can place “overlay” widgets. The position of each overlay widget is determined by its- Gtk.Widget- :halignand- Gtk.Widget- :valignproperties. E.g. a widget with both alignments set to- Gtk.Align.STARTwill be placed at the top left corner of the- Gtk.Overlaycontainer, whereas an overlay with halign set to- Gtk.Align.CENTERand valign set to- Gtk.Align.ENDwill be placed a the bottom edge of the- Gtk.Overlay, horizontally centered. The position can be adjusted by setting the margin properties of the child to non-zero values.- More complicated placement of overlays is possible by connecting to the - Gtk.Overlay- ::get-child-positionsignal.- An overlay’s minimum and natural sizes are those of its main child. The sizes of overlay children are not considered when measuring these preferred sizes. - The - Gtk.Overlayimplementation of the- Gtk.Buildableinterface supports placing a child as an overlay by specifying “overlay” as the “type” attribute of a- <child>element.- CSS nodes
 - Gtk.Overlayhas a single CSS node with the name “overlay”. Overlay children whose alignments cause them to be positioned at an edge get the style classes “.left”, “.right”, “.top”, and/or “.bottom” according to their position.- 
classmethod new()[source]¶
- Returns: - a new - Gtk.Overlayobject.- Return type: - Gtk.Widget- Creates a new - Gtk.Overlay.- New in version 3.2. 
 - 
add_overlay(widget)[source]¶
- Parameters: - widget ( - Gtk.Widget) – a- Gtk.Widgetto be added to the container- Adds widget to self. - The widget will be stacked on top of the main widget added with - Gtk.Container.add().- The position at which widget is placed is determined from its - Gtk.Widget- :halignand- Gtk.Widget- :valignproperties.- New in version 3.2. 
 - 
get_overlay_pass_through(widget)[source]¶
- Parameters: - widget ( - Gtk.Widget) – an overlay child of- Gtk.Overlay- Returns: - whether the widget is a pass through child. - Return type: - bool- Convenience function to get the value of the - Gtk.Overlay- :pass-throughchild property for widget.- New in version 3.18. 
 - 
reorder_overlay(child, index_)[source]¶
- Parameters: - child (Gtk.Widget) – the overlaidGtk.Widgetto move
- index (int) – the new index for child in the list of overlay children of self, starting from 0. If negative, indicates the end of the list
 - Moves child to a new index in the list of self children. The list contains overlays in the order that these were added to self by default. See also - Gtk.Overlay- :index.- A widget’s index in the self children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order. - New in version 3.18. 
- child (
 - 
set_overlay_pass_through(widget, pass_through)[source]¶
- Parameters: - widget (Gtk.Widget) – an overlay child ofGtk.Overlay
- pass_through (bool) – whether the child should pass the input through
 - Convenience function to set the value of the - Gtk.Overlay- :pass-throughchild property for widget.- New in version 3.18. 
- widget (
 - 
do_get_child_position(widget, allocation) virtual¶
- Parameters: - widget (Gtk.Widget) –
- allocation (Gdk.Rectangle) –
 - Return type: 
- widget (
 
Signal Details¶
- 
Gtk.Overlay.signals.get_child_position(overlay, widget)¶
- Signal Name: - get-child-position- Flags: - Parameters: - overlay (Gtk.Overlay) – The object which received the signal
- widget (Gtk.Widget) – the child widget to position
 - Returns: - Trueif the allocation has been filled- allocation: - return location for the allocation - Return type: - ( - bool, allocation:- Gdk.Rectangle)- The - ::get-child-positionsignal is 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 for widget, relative to the ‘main’ child of overlay.- 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 of - Gtk.Align.FILLwill cause the overlay to be full-width/height). If the main child is a- Gtk.ScrolledWindow, the overlays are placed relative to its contents.
- overlay (