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 | new (hadjustment, vadjustment) |
get_bin_window () |
|
get_hadjustment () |
|
get_shadow_type () |
|
get_vadjustment () |
|
get_view_window () |
|
set_hadjustment (adjustment) |
|
set_shadow_type (type) |
|
set_vadjustment (adjustment) |
Virtual Methods¶
Inherited: | Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Scrollable (1) |
---|
Properties¶
Inherited: | Gtk.Container (3), Gtk.Widget (39), Gtk.Scrollable (4) |
---|
Name | Type | Flags | Short Description |
---|---|---|---|
shadow-type |
Gtk.ShadowType |
r/w/en | Determines how the shadowed box around the viewport is drawn |
Style Properties¶
Inherited: | Gtk.Widget (17) |
---|
Signals¶
Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) |
---|
Fields¶
Inherited: | Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) |
---|
Name | Type | Access | Description |
---|---|---|---|
bin | Gtk.Bin |
r |
Class Details¶
-
class
Gtk.
Viewport
(*args, **kwargs)¶ Bases: Gtk.Bin
,Gtk.Scrollable
Abstract: No Structure: Gtk.ViewportClass
The
Gtk.Viewport
widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. UseGtk.Viewport
to scroll child widgets such asGtk.Grid
,Gtk.Box
, and so on.If a widget has native scrolling abilities, such as
Gtk.TextView
,Gtk.TreeView
orGtk.IconView
, it can be added to aGtk.ScrolledWindow
withGtk.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.Scrollable
is added to aGtk.ScrolledWindow
, so you can ignore the presence of the viewport.The
Gtk.Viewport
will start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.- CSS nodes
Gtk.Viewport
has a single CSS node with name viewport.-
classmethod
new
(hadjustment, vadjustment)[source]¶ Parameters: - hadjustment (
Gtk.Adjustment
orNone
) – horizontal adjustment - vadjustment (
Gtk.Adjustment
orNone
) – vertical adjustment
Returns: a new
Gtk.Viewport
Return type: Creates a new
Gtk.Viewport
with the given adjustments, or with default adjustments if none are given.- hadjustment (
-
get_bin_window
()[source]¶ Returns: a Gdk.Window
Return type: Gdk.Window
Gets the bin window of the
Gtk.Viewport
.New in version 2.20.
-
get_hadjustment
()[source]¶ Returns: the horizontal adjustment of self. Return type: Gtk.Adjustment
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: Gtk.ShadowType
Gets the shadow type of the
Gtk.Viewport
. SeeGtk.Viewport.set_shadow_type
().
-
get_vadjustment
()[source]¶ Returns: the vertical adjustment of self. Return type: Gtk.Adjustment
Returns the vertical adjustment of the viewport.
Deprecated since version 3.0: Use
Gtk.Scrollable.get_vadjustment
()
-
get_view_window
()[source]¶ Returns: a Gdk.Window
Return type: Gdk.Window
Gets the view window of the
Gtk.Viewport
.New in version 2.22.
-
set_hadjustment
(adjustment)[source]¶ Parameters: adjustment ( Gtk.Adjustment
orNone
) – 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.Adjustment
orNone
) – 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: Gtk.ShadowType
Default Value: Gtk.ShadowType.IN
Flags: READABLE
,WRITABLE
,EXPLICIT_NOTIFY
Determines how the shadowed box around the viewport is drawn