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.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.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.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gtk.adjustment.Adjustment hadjustment, gtk.adjustment.Adjustment vadjustment)

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

Members

Functions

getBinWindow
gdk.window.Window getBinWindow()

Gets the bin window of the #GtkViewport.

getHadjustment
gtk.adjustment.Adjustment getHadjustment()

Returns the horizontal adjustment of the viewport.

getShadowType
gtk.types.ShadowType getShadowType()

Gets the shadow type of the #GtkViewport. See gtk.viewport.Viewport.setShadowType.

getVadjustment
gtk.adjustment.Adjustment getVadjustment()

Returns the vertical adjustment of the viewport.

getViewWindow
gdk.window.Window getViewWindow()

Gets the view window of the #GtkViewport.

self
Viewport self()

Returns this, for use in with statements.

setHadjustment
void setHadjustment(gtk.adjustment.Adjustment adjustment)

Sets the horizontal adjustment of the viewport.

setShadowType
void setShadowType(gtk.types.ShadowType type)

Sets the shadow type of the viewport.

setVadjustment
void setVadjustment(gtk.adjustment.Adjustment adjustment)

Sets the vertical adjustment of the viewport.

Properties

_gType
GType _gType [@property getter]
shadowType
gtk.types.ShadowType shadowType [@property getter]
shadowType
gtk.types.ShadowType shadowType [@property setter]

Static functions

_getGType
GType _getGType()
builder
ViewportGidBuilder builder()

Get builder for gtk.viewport.Viewport

Mixed In Members

From mixin ScrollableT!()

hadjustment
gtk.adjustment.Adjustment hadjustment [@property getter]

Get hadjustment property.

hadjustment
gtk.adjustment.Adjustment hadjustment [@property setter]

Set hadjustment property.

hscrollPolicy
gtk.types.ScrollablePolicy hscrollPolicy [@property getter]

Get hscrollPolicy property.

hscrollPolicy
gtk.types.ScrollablePolicy hscrollPolicy [@property setter]

Set hscrollPolicy property.

vadjustment
gtk.adjustment.Adjustment vadjustment [@property getter]

Get vadjustment property.

vadjustment
gtk.adjustment.Adjustment vadjustment [@property setter]

Set vadjustment property.

vscrollPolicy
gtk.types.ScrollablePolicy vscrollPolicy [@property getter]

Get vscrollPolicy property.

vscrollPolicy
gtk.types.ScrollablePolicy vscrollPolicy [@property setter]

Set vscrollPolicy property.

getBorder
bool getBorder(gtk.border.Border border)

Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK+ can use this information to display overlayed graphics, like the overshoot indication, at the right position.

getHadjustment
gtk.adjustment.Adjustment getHadjustment()

Retrieves the #GtkAdjustment used for horizontal scrolling.

getHscrollPolicy
gtk.types.ScrollablePolicy getHscrollPolicy()

Gets the horizontal #GtkScrollablePolicy.

getVadjustment
gtk.adjustment.Adjustment getVadjustment()

Retrieves the #GtkAdjustment used for vertical scrolling.

getVscrollPolicy
gtk.types.ScrollablePolicy getVscrollPolicy()

Gets the vertical #GtkScrollablePolicy.

setHadjustment
void setHadjustment(gtk.adjustment.Adjustment hadjustment)

Sets the horizontal adjustment of the #GtkScrollable.

setHscrollPolicy
void setHscrollPolicy(gtk.types.ScrollablePolicy policy)

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

setVadjustment
void setVadjustment(gtk.adjustment.Adjustment vadjustment)

Sets the vertical adjustment of the #GtkScrollable.

setVscrollPolicy
void setVscrollPolicy(gtk.types.ScrollablePolicy policy)

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

Inherited Members

From Bin

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Bin self()

Returns this, for use in with statements.

builder
BinGidBuilder builder()

Get builder for gtk.bin.Bin

getChild
gtk.widget.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 Scrollable

_getGType
GType _getGType()
hadjustment
gtk.adjustment.Adjustment hadjustment [@property getter]

Get hadjustment property.

hadjustment
gtk.adjustment.Adjustment hadjustment [@property setter]

Set hadjustment property.

hscrollPolicy
gtk.types.ScrollablePolicy hscrollPolicy [@property getter]

Get hscrollPolicy property.

hscrollPolicy
gtk.types.ScrollablePolicy hscrollPolicy [@property setter]

Set hscrollPolicy property.

vadjustment
gtk.adjustment.Adjustment vadjustment [@property getter]

Get vadjustment property.

vadjustment
gtk.adjustment.Adjustment vadjustment [@property setter]

Set vadjustment property.

vscrollPolicy
gtk.types.ScrollablePolicy vscrollPolicy [@property getter]

Get vscrollPolicy property.

vscrollPolicy
gtk.types.ScrollablePolicy vscrollPolicy [@property setter]

Set vscrollPolicy property.

getBorder
bool getBorder(gtk.border.Border border)

Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK+ can use this information to display overlayed graphics, like the overshoot indication, at the right position.

getHadjustment
gtk.adjustment.Adjustment getHadjustment()

Retrieves the #GtkAdjustment used for horizontal scrolling.

getHscrollPolicy
gtk.types.ScrollablePolicy getHscrollPolicy()

Gets the horizontal #GtkScrollablePolicy.

getVadjustment
gtk.adjustment.Adjustment getVadjustment()

Retrieves the #GtkAdjustment used for vertical scrolling.

getVscrollPolicy
gtk.types.ScrollablePolicy getVscrollPolicy()

Gets the vertical #GtkScrollablePolicy.

setHadjustment
void setHadjustment(gtk.adjustment.Adjustment hadjustment)

Sets the horizontal adjustment of the #GtkScrollable.

setHscrollPolicy
void setHscrollPolicy(gtk.types.ScrollablePolicy policy)

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

setVadjustment
void setVadjustment(gtk.adjustment.Adjustment vadjustment)

Sets the vertical adjustment of the #GtkScrollable.

setVscrollPolicy
void setVscrollPolicy(gtk.types.ScrollablePolicy policy)

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