Viewport

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.

Constructors

this
this(GtkViewport* gtkViewport)

Sets our main struct and passes it to the parent class

this
this(Adjustment hadjustment, Adjustment vadjustment)

Creates a new GtkViewport with the given adjustments, or with default adjustments if none are given.

Members

Functions

getBinWindow
Window getBinWindow()

Gets the bin window of the GtkViewport. Since 2.20

getShadowType
GtkShadowType getShadowType()

Gets the shadow type of the GtkViewport. See gtk_viewport_set_shadow_type().

getStruct
void* getStruct()

the main Gtk struct as a void*

getViewWindow
Window getViewWindow()

Gets the view window of the GtkViewport. Since 2.22

getViewportStruct
GtkViewport* getViewportStruct()

Get the main Gtk struct

setShadowType
void setShadowType(GtkShadowType type)

Sets the shadow type of the viewport.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin ScrollableT!(GtkViewport)
Undocumented in source.

Variables

gtkViewport
GtkViewport* gtkViewport;

the main Gtk struct

Inherited Members

From Bin

gtkBin
GtkBin* gtkBin;

the main Gtk struct

getBinStruct
GtkBin* getBinStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getChild
Widget getChild()

Gets the child of the GtkBin, or NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.

From ScrollableIF

getScrollableTStruct
GtkScrollable* getScrollableTStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getHadjustment
Adjustment getHadjustment()

Retrieves the GtkAdjustment used for horizontal scrolling.

setHadjustment
void setHadjustment(Adjustment hadjustment)

Sets the horizontal adjustment of the GtkScrollable.

getVadjustment
Adjustment getVadjustment()

Retrieves the GtkAdjustment used for vertical scrolling.

setVadjustment
void setVadjustment(Adjustment vadjustment)

Sets the vertical adjustment of the GtkScrollable.

getHscrollPolicy
GtkScrollablePolicy getHscrollPolicy()

Gets the horizontal GtkScrollablePolicy.

setHscrollPolicy
void setHscrollPolicy(GtkScrollablePolicy policy)

Sets the GtkScrollablePolicy to determine whether horizontal scrolling should start below the minimum width or below the natural width.

getVscrollPolicy
GtkScrollablePolicy getVscrollPolicy()

Gets the vertical GtkScrollablePolicy.

setVscrollPolicy
void setVscrollPolicy(GtkScrollablePolicy policy)

Sets the GtkScrollablePolicy to determine whether vertical scrolling should start below the minimum height or below the natural height.

Meta