Package: gtk

Class gtk-viewport

Superclasses

gtk-bin, gtk-container, gtk-widget, gtk-buildable, gtk-scrollable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

shadow-type
The shadow-type property of type gtk-shadow-type (Read / Write)
Determines how the shadowed box around the viewport is drawn.
Default value: :in

Details

The gtk-viewport widget acts as an adaptor class, implementing scrollability for child widgets that lack their own scrolling capabilities. Use the gtk-viewport widget to scroll child widgets such as the widgets gtk-grid, gtk-box, and so on.

If a widget has native scrolling abilities, such as the widgets gtk-text-view, gtk-tree-view or gtk-icon-view, it can be added to a gtk-scrolled-window widget with the function gtk-container-add. If a widget does not, you must first add the widget to a gtk-viewport widget, then add the viewport to the scrolled window. The function gtk-container-add does this automatically if a child that does not implement the gtk-scrollable interface is added to a gtk-scrolled-window widget, so you can ignore the presence of the viewport.

The gtk-viewport widget will start scrolling content only if allocated less than the child widget's minimum size in a given orientation.

CSS nodes

The gtk-viewport widget has a single CSS node with name viewport.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2021-3-19