Viewport
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
, Scrollable
- Constructors:
Viewport(**properties)
new(hadjustment:Gtk.Adjustment=None, vadjustment:Gtk.Adjustment=None) -> Gtk.Widget
Constructors
- class Viewport
- classmethod new(hadjustment: Adjustment | None = None, vadjustment: Adjustment | None = None) Widget
Creates a new
GtkViewport
.The new viewport uses the given adjustments, or default adjustments if none are given.
- Parameters:
hadjustment – horizontal adjustment
vadjustment – vertical adjustment
Methods
- class Viewport
-
- get_scroll_to_focus() bool
Gets whether the viewport is scrolling to keep the focused child in view.
- scroll_to(descendant: Widget, scroll: ScrollInfo | None = None) None
Scrolls a descendant of the viewport into view.
The viewport and the descendant must be visible and mapped for this function to work, otherwise no scrolling will be performed.
Added in version 4.12.
- Parameters:
descendant – a descendant widget of the viewport
scroll – details of how to perform the scroll operation or NULL to scroll into view