Gtk.Viewport¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
Determines how the shadowed box around the viewport is drawn |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
bin |
r |
Class Details¶
- class Gtk.Viewport(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Gtk.Viewportwidget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. UseGtk.Viewportto scroll child widgets such asGtk.Grid,Gtk.Box, and so on.If a widget has native scrolling abilities, such as
Gtk.TextView,Gtk.TreeVieworGtk.IconView, it can be added to aGtk.ScrolledWindowwithGtk.Container.add(). If a widget does not, you must first add the widget to aGtk.Viewport, then add the viewport to the scrolled window.Gtk.Container.add() does this automatically if a child that does not implementGtk.Scrollableis added to aGtk.ScrolledWindow, so you can ignore the presence of the viewport.The
Gtk.Viewportwill start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.- CSS nodes
Gtk.Viewporthas a single CSS node with name viewport.- classmethod new(hadjustment, vadjustment)[source]¶
- Parameters:
hadjustment (
Gtk.AdjustmentorNone) – horizontal adjustmentvadjustment (
Gtk.AdjustmentorNone) – vertical adjustment
- Returns:
a new
Gtk.Viewport- Return type:
Creates a new
Gtk.Viewportwith the given adjustments, or with default adjustments if none are given.
- get_bin_window()[source]¶
- Returns:
- Return type:
Gets the bin window of the
Gtk.Viewport.New in version 2.20.
- get_hadjustment()[source]¶
- Returns:
the horizontal adjustment of self.
- Return type:
Returns the horizontal adjustment of the viewport.
Deprecated since version 3.0: Use
Gtk.Scrollable.get_hadjustment()
- get_shadow_type()[source]¶
- Returns:
the shadow type
- Return type:
Gets the shadow type of the
Gtk.Viewport. SeeGtk.Viewport.set_shadow_type().
- get_vadjustment()[source]¶
- Returns:
the vertical adjustment of self.
- Return type:
Returns the vertical adjustment of the viewport.
Deprecated since version 3.0: Use
Gtk.Scrollable.get_vadjustment()
- get_view_window()[source]¶
- Returns:
- Return type:
Gets the view window of the
Gtk.Viewport.New in version 2.22.
- set_hadjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.AdjustmentorNone) – aGtk.Adjustment.
Sets the horizontal adjustment of the viewport.
Deprecated since version 3.0: Use
Gtk.Scrollable.set_hadjustment()
- set_shadow_type(type)[source]¶
- Parameters:
type (
Gtk.ShadowType) – the new shadow type.
Sets the shadow type of the viewport.
- set_vadjustment(adjustment)[source]¶
- Parameters:
adjustment (
Gtk.AdjustmentorNone) – aGtk.Adjustment.
Sets the vertical adjustment of the viewport.
Deprecated since version 3.0: Use
Gtk.Scrollable.set_vadjustment()
Property Details¶
- Gtk.Viewport.props.shadow_type¶
- Name:
shadow-type- Type:
- Default Value:
- Flags:
Determines how the shadowed box around the viewport is drawn