Gtk.Viewport¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), 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
GtkViewport
implements scrollability for widgets that lack their own scrolling capabilities.Use
GtkViewport
to scroll child widgets such asGtkGrid
,GtkBox
, and so on.The
GtkViewport
will start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.- CSS nodes
GtkViewport
has a single CSS node with nameviewport
.- Accessibility
Until GTK 4.10,
GtkViewport
used theGTK_ACCESSIBLE_ROLE_GROUP
role.Starting from GTK 4.12,
GtkViewport
uses theGTK_ACCESSIBLE_ROLE_GENERIC
role.- classmethod new(hadjustment, vadjustment)[source]¶
- Parameters:
hadjustment (
Gtk.Adjustment
orNone
) – horizontal adjustmentvadjustment (
Gtk.Adjustment
orNone
) – 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.Widget
orNone
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.ScrollInfo
orNone
) – details of how to perform the scroll operation orNone
to 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.Widget
orNone
) – the child widget
Sets the child widget of self.
Property Details¶
- Gtk.Viewport.props.child¶
- Name:
child
- Type:
- Default Value:
- Flags:
The child widget.