Gtk.Viewport¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.Scrollable (9)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.Viewport(**kwargs)¶
- Bases:
- Abstract:
No
Implements scrollability for widgets that don’t support scrolling on their own.
Use
GtkViewportto scroll child widgets such asGtkGrid,GtkBox, and so on.The
GtkViewportwill start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.- CSS nodes
GtkViewporthas a single CSS node with nameviewport.- Accessibility
Until GTK 4.10,
GtkViewportused the [enum`Gtk`.AccessibleRole.group] role.Starting from GTK 4.12,
GtkViewportuses the [enum`Gtk`.AccessibleRole.generic] role.- classmethod new(hadjustment, vadjustment)[source]¶
- Parameters:
hadjustment (
Gtk.AdjustmentorNone) – horizontal adjustmentvadjustment (
Gtk.AdjustmentorNone) – vertical adjustment
- Returns:
a new
GtkViewport- Return type:
Creates a new
GtkViewport.The new viewport uses the given adjustments, or default adjustments if none are given.
- get_child()[source]¶
- Returns:
the child widget of self
- Return type:
Gtk.WidgetorNone
Gets the child widget of self.
- get_scroll_to_focus()[source]¶
-
Gets whether the viewport is scrolling to keep the focused child in view.
- scroll_to(descendant, scroll)[source]¶
- Parameters:
descendant (
Gtk.Widget) – a descendant widget of the viewportscroll (
Gtk.ScrollInfoorNone) – details of how to perform the scroll operation orNoneto scroll into view
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.
New in version 4.12.
- set_child(child)[source]¶
- Parameters:
child (
Gtk.WidgetorNone) – the child widget
Sets the child widget of self.
Property Details¶
- Gtk.Viewport.props.child¶
- Name:
child- Type:
- Default Value:
- Flags:
The child widget.