| Top |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkViewport
The CtkViewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use CtkViewport to scroll child widgets such as CtkGrid, CtkBox, and so on.
If a widget has native scrolling abilities, such as CtkTextView,
CtkTreeView or CtkIconView, it can be added to a CtkScrolledWindow
with ctk_container_add(). If a widget does not, you must first add the
widget to a CtkViewport, then add the viewport to the scrolled window.
ctk_container_add() does this automatically if a child that does not
implement CtkScrollable is added to a CtkScrolledWindow, so you can
ignore the presence of the viewport.
The CtkViewport will start scrolling content only if allocated less than the child widget’s minimum size in a given orientation.
CtkWidget * ctk_viewport_new (CtkAdjustment *hadjustment,CtkAdjustment *vadjustment);
Creates a new CtkViewport with the given adjustments, or with default adjustments if none are given.
CtkAdjustment *
ctk_viewport_get_hadjustment (CtkViewport *viewport);
ctk_viewport_get_hadjustment has been deprecated since version 3.0 and should not be used in newly-written code.
Returns the horizontal adjustment of the viewport.
CtkAdjustment *
ctk_viewport_get_vadjustment (CtkViewport *viewport);
ctk_viewport_get_vadjustment has been deprecated since version 3.0 and should not be used in newly-written code.
Returns the vertical adjustment of the viewport.
void ctk_viewport_set_hadjustment (CtkViewport *viewport,CtkAdjustment *adjustment);
ctk_viewport_set_hadjustment has been deprecated since version 3.0 and should not be used in newly-written code.
Sets the horizontal adjustment of the viewport.
void ctk_viewport_set_vadjustment (CtkViewport *viewport,CtkAdjustment *adjustment);
ctk_viewport_set_vadjustment has been deprecated since version 3.0 and should not be used in newly-written code.
Sets the vertical adjustment of the viewport.
void ctk_viewport_set_shadow_type (CtkViewport *viewport,CtkShadowType type);
Sets the shadow type of the viewport.
CtkShadowType
ctk_viewport_get_shadow_type (CtkViewport *viewport);
Gets the shadow type of the CtkViewport. See
ctk_viewport_set_shadow_type().
CdkWindow *
ctk_viewport_get_bin_window (CtkViewport *viewport);
Gets the bin window of the CtkViewport.
Since: 2.20
CdkWindow *
ctk_viewport_get_view_window (CtkViewport *viewport);
Gets the view window of the CtkViewport.
Since: 2.22
“shadow-type” property“shadow-type” CtkShadowType
Determines how the shadowed box around the viewport is drawn.
Owner: CtkViewport
Flags: Read / Write
Default value: CTK_SHADOW_IN