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, bool ownedRef)

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.

getHadjustment
Adjustment getHadjustment()

Returns the horizontal adjustment of the viewport.

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*

getVadjustment
Adjustment getVadjustment()

Returns the vertical adjustment of the viewport.

getViewWindow
Window getViewWindow()

Gets the view window of the #GtkViewport.

getViewportStruct
GtkViewport* getViewportStruct()

Get the main Gtk struct

setHadjustment
void setHadjustment(Adjustment adjustment)

Sets the horizontal adjustment of the viewport.

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.
setVadjustment
void setVadjustment(Adjustment adjustment)

Sets the vertical adjustment of the viewport.

Mixins

__anonymous
mixin ScrollableT!(GtkViewport)
Undocumented in source.

Static functions

getType
GType getType()

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.
getType
GType getType()
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

getScrollableStruct
GtkScrollable* getScrollableStruct()

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.

getHscrollPolicy
GtkScrollablePolicy getHscrollPolicy()

Gets the horizontal #GtkScrollablePolicy.

getVadjustment
Adjustment getVadjustment()

Retrieves the #GtkAdjustment used for vertical scrolling.

getVscrollPolicy
GtkScrollablePolicy getVscrollPolicy()

Gets the vertical #GtkScrollablePolicy.

setHadjustment
void setHadjustment(Adjustment hadjustment)

Sets the horizontal adjustment of the #GtkScrollable.

setHscrollPolicy
void setHscrollPolicy(GtkScrollablePolicy policy)

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

setVadjustment
void setVadjustment(Adjustment vadjustment)

Sets the vertical adjustment of the #GtkScrollable.

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