GtkViewport
GtkViewport — An adapter which makes widgets scrollable
|
|
Includes
#include <gtk/gtk.h>
Description
The GtkViewport widget acts as an adaptor class, implementing
scrollability for child widgets that lack their own scrolling
capabilities. Use GtkViewport to scroll child widgets such as
GtkGrid, GtkBox, and so on.
If a widget has native scrolling abilities, such as GtkTextView,
GtkTreeView or GtkIconView, it can be added to a GtkScrolledWindow
with gtk_container_add(). If a widget does not, you must first add the
widget to a GtkViewport, then add the viewport to the scrolled window.
gtk_container_add() does this automatically if a child that does not
implement GtkScrollable is added to a GtkScrolledWindow, so you can
ignore the presence of the viewport.
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 name viewport.
Functions
gtk_viewport_get_hadjustment ()
GtkAdjustment *
gtk_viewport_get_hadjustment (GtkViewport *viewport);
Returns the horizontal adjustment of the viewport.
Returns
the horizontal adjustment of viewport
.
[transfer none]
gtk_viewport_get_vadjustment ()
GtkAdjustment *
gtk_viewport_get_vadjustment (GtkViewport *viewport);
Returns the vertical adjustment of the viewport.
Returns
the vertical adjustment of viewport
.
[transfer none]
gtk_viewport_set_hadjustment ()
void
gtk_viewport_set_hadjustment (GtkViewport *viewport,
GtkAdjustment *adjustment);
Sets the horizontal adjustment of the viewport.
gtk_viewport_set_vadjustment ()
void
gtk_viewport_set_vadjustment (GtkViewport *viewport,
GtkAdjustment *adjustment);
Sets the vertical adjustment of the viewport.
gtk_viewport_set_shadow_type ()
void
gtk_viewport_set_shadow_type (GtkViewport *viewport,
GtkShadowType type);
Sets the shadow type of the viewport.
Types and Values
struct GtkViewport
struct GtkViewport;
struct GtkViewportClass
struct GtkViewportClass {
GtkBinClass parent_class;
};
Property Details
The “shadow-type” property
“shadow-type” GtkShadowType
Determines how the shadowed box around the viewport is drawn.
Owner: GtkViewport
Flags: Read / Write
Default value: GTK_SHADOW_IN