Sets our main struct and passes it to the parent class.
Creates a new Scrolled window and set the policy type
Creates a new scrolled window.
The ::edge-overshot signal is emitted whenever user initiated scrolling makes the scrolledwindow firmly surpass (ie. with some edge resistance) the lower or upper limits defined by the adjustment in that orientation.
The ::edge-reached signal is emitted whenever user-initiated scrolling makes the scrolledwindow exactly reaches the lower or upper limits defined by the adjustment in that orientation.
The ::move-focus-out signal is a [keybinding signal]GtkBindingSignal which gets emitted when focus is moved away from the scrolled window by a keybinding. The #GtkWidget::move-focus signal is emitted with @direction_type on this scrolled windows toplevel parent in the container hierarchy. The default bindings for this signal are Tab + Ctrl and Tab + Ctrl + Shift.
The ::scroll-child signal is a [keybinding signal]GtkBindingSignal which gets emitted when a keybinding that scrolls is pressed. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled windows child may listen to and scroll itself.
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 gtk_container_add() instead of this function.
Return whether button presses are captured during kinetic scrolling. See gtk_scrolled_window_set_capture_button_press().
Returns the horizontal scrollbar’s adjustment, used to connect the horizontal scrollbar to the child widget’s horizontal scroll functionality.
Returns the horizontal scrollbar of @scrolled_window.
Returns the specified kinetic scrolling behavior.
Returns the maximum content height set.
Returns the maximum content width set.
Gets the minimal content height of @scrolled_window, or -1 if not set.
Gets the minimum content width of @scrolled_window, or -1 if not set.
Returns whether overlay scrolling is enabled for this scrolled window.
Gets the placement of the contents with respect to the scrollbars for the scrolled window. See gtk_scrolled_window_set_placement().
Retrieves the current policy values for the horizontal and vertical scrollbars. See gtk_scrolled_window_set_policy().
Reports whether the natural height of the child will be calculated and propagated through the scrolled windows requested natural height.
Reports whether the natural width of the child will be calculated and propagated through the scrolled windows requested natural width.
Get the main Gtk struct
Gets the shadow type of the scrolled window. See gtk_scrolled_window_set_shadow_type().
the main Gtk struct as a void*
Returns the vertical scrollbar’s adjustment, used to connect the vertical scrollbar to the child widget’s vertical scroll functionality.
Returns the vertical scrollbar of @scrolled_window.
Changes the behaviour of @scrolled_window with regard to the initial event that possibly starts kinetic scrolling. When @capture_button_press is set to %TRUE, the event is captured by the scrolled window, and then later replayed if it is meant to go to the child widget.
Sets the #GtkAdjustment for the horizontal scrollbar.
Turns kinetic scrolling on or off. Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.
Sets the maximum height that @scrolled_window should keep visible. The @scrolled_window will grow up to this height before it starts scrolling the content.
Sets the maximum width that @scrolled_window should keep visible. The @scrolled_window will grow up to this width before it starts scrolling the content.
Sets the minimum height that @scrolled_window should keep visible. Note that this can and (usually will) be smaller than the minimum size of the content.
Sets the minimum width that @scrolled_window should keep visible. Note that this can and (usually will) be smaller than the minimum size of the content.
Enables or disables overlay scrolling for this scrolled window.
Sets the placement of the contents with respect to the scrollbars for the scrolled window.
Sets the scrollbar policy for the horizontal and vertical scrollbars.
Sets whether the natural height of the child should be calculated and propagated through the scrolled windows requested natural height.
Sets whether the natural width of the child should be calculated and propagated through the scrolled windows requested natural width.
Changes the type of shadow drawn around the contents of @scrolled_window.
Sets the #GtkAdjustment for the vertical scrollbar.
Unsets the placement of the contents with respect to the scrollbars for the scrolled window. If no window placement is set for a scrolled window, it defaults to %GTK_CORNER_TOP_LEFT.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
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.
GtkScrolledWindow is a container that accepts a single child widget, makes that child scrollable using either internally added scrollbars or externally associated adjustments, and optionally draws a frame around the child.
Widgets with native scrolling support, i.e. those whose classes implement the #GtkScrollable interface, are added directly. For other types of widget, the class #GtkViewport acts as an adaptor, giving scrollability to other widgets. GtkScrolledWindow’s implementation of gtk_container_add() intelligently accounts for whether or not the added child is a #GtkScrollable. If it isn’t, #GtkScrolledWindow wraps the child in a #GtkViewport and adds that for you. Therefore, you can just add any child widget and not worry about the details.
If gtk_container_add() has added a #GtkViewport for you, you can remove both your added child widget from the #GtkViewport, and the #GtkViewport from the GtkScrolledWindow, with either of these calls: |[<!-- language="C" --> gtk_container_remove (GTK_CONTAINER (scrolled_window), child_widget); // or gtk_container_remove (GTK_CONTAINER (scrolled_window), gtk_bin_get_child (GTK_BIN (scrolled_window))); ]|
Unless #GtkScrolledWindow:policy is GTK_POLICY_NEVER or GTK_POLICY_EXTERNAL, GtkScrolledWindow adds internal #GtkScrollbar widgets around its child. The scroll position of the child, and if applicable the scrollbars, is controlled by the #GtkScrolledWindow:hadjustment and #GtkScrolledWindow:vadjustment that are associated with the GtkScrolledWindow. See the docs on #GtkScrollbar for the details, but note that the “step_increment” and “page_increment” fields are only effective if the policy causes scrollbars to be present.
If a GtkScrolledWindow doesn’t behave quite as you would like, or doesn’t have exactly the right layout, it’s very possible to set up your own scrolling with #GtkScrollbar and for example a #GtkGrid.
Touch support
GtkScrolledWindow has built-in support for touch devices. When a touchscreen is used, swiping will move the scrolled window, and will expose 'kinetic' behavior. This can be turned off with the #GtkScrolledWindow:kinetic-scrolling property if it is undesired.
GtkScrolledWindow also displays visual 'overshoot' indication when the content is pulled beyond the end, and this situation can be captured with the #GtkScrolledWindow::edge-overshot signal.
If no mouse device is present, the scrollbars will overlayed as narrow, auto-hiding indicators over the content. If traditional scrollbars are desired although no mouse is present, this behaviour can be turned off with the #GtkScrolledWindow:overlay-scrolling property.
CSS nodes
GtkScrolledWindow has a main CSS node with name scrolledwindow.
It uses subnodes with names overshoot and undershoot to draw the overflow and underflow indications. These nodes get the .left, .right, .top or .bottom style class added depending on where the indication is drawn.
GtkScrolledWindow also sets the positional style classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering) on its scrollbars.
If both scrollbars are visible, the area where they meet is drawn with a subnode named junction.