Package: gtk

Function gtk-scrolled-window-add-with-viewport

Lambda List

gtk-scrolled-window-add-with-viewport (window child)

Arguments

window -- a gtk-scrolled-window widget
child -- the gtk-widget object you want to scroll

Details

Used to add children without native scrolling capabilities. This is simply a convenience function. It is equivalent to adding the unscrollable child to a viewport, then adding the viewport to the scrolled window. If a child has native scrolling, use the gtk-container-add function instead of this function.

The viewport scrolls the child by moving its gdk-window object, and takes the size of the child to be the size of its toplevel gdk-window object. This will be very wrong for most widgets that support native scrolling. For example, if you add a widget such as gtk-tree-view widget with a viewport, the whole widget will scroll, including the column headings. Thus, widgets with native scrolling support should not be used with the gtk-viewport proxy.

A widget supports scrolling natively if it implements the gtk-scrollable interface.

Warning

The gtk-scrolled-window-add-with-viewport function has been deprecated since version 3.8 and should not be used in newly written code. The gtk-container-add function will automatically add a gtk-viewport widget if the child does not implement the gtk-scrollable interface.
 

See also

2021-10-14