gtk.viewport
Module for [Viewport] class
Types 3
gtk.viewport.Viewport implements scrollability for widgets that lack their own scrolling capabilities.
Use gtk.viewport.Viewport to scroll child widgets such as gtk.grid.Grid, gtk.box.Box, and so on.
The gtk.viewport.Viewport will start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.
CSS nodes
gtk.viewport.Viewport has a single CSS node with name viewport.
Accessibility
Until GTK 4.10, gtk.viewport.Viewport used the gtk.types.AccessibleRole.Group role.
Starting from GTK 4.12, gtk.viewport.Viewport uses the gtk.types.AccessibleRole.Generic role.
Methods
ViewportGidBuilder builder() static nothrowGet builder for [gtk.viewport.Viewport] Returns: New builder objectvoid child(gtk.widget.Widget propval) @property nothrowSet `child` property. Params: propval = The child widget.bool scrollToFocus() @property nothrowGet `scrollToFocus` property. Returns: Whether to scroll when the focus changes.void scrollToFocus(bool propval) @property nothrowSet `scrollToFocus` property. Params: propval = Whether to scroll when the focus changes.gtk.widget.Widget getChild() nothrowGets the child widget of viewport. Returns: the child widget of viewportbool getScrollToFocus() nothrowGets whether the viewport is scrolling to keep the focused child in view. Returns: true if the viewport keeps the focus child scrolled to viewvoid scrollTo(gtk.widget.Widget descendant, gtk.scroll_info.ScrollInfo scroll = null) nothrowScrolls a descendant of the viewport into view.void setScrollToFocus(bool scrollToFocus) nothrowSets whether the viewport should automatically scroll to keep the focused child in view.Constructors
this(gtk.adjustment.Adjustment hadjustment = null, gtk.adjustment.Adjustment vadjustment = null)Creates a new [gtk.viewport.Viewport].classViewportGidBuilderImpl(T) : gtk.widget.WidgetGidBuilderImpl!T, gtk.scrollable.ScrollableGidBuilderImpl!T
Fluent builder implementation template for gtk.viewport.Viewport
Methods
T child(gtk.widget.Widget propval) nothrowSet `child` property. Params: propval = The child widget. Returns: Builder instance for fluent chainingT scrollToFocus(bool propval) nothrowSet `scrollToFocus` property. Params: propval = Whether to scroll when the focus changes.Fluent builder for gtk.viewport.Viewport