Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ScrolledWindowEdgeovershotCallback

[870:7] extends: object

Generated low-level callback wrapper for GIR callback edge-overshot.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ScrolledWindowEdgeovershotCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, pos, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ScrolledWindowMeta

[1155:14] static extends: object

Generated metadata helpers for ScrolledWindow class surfaces.

Methods

  • properties ()

    Returns property metadata for ScrolledWindow.

    • @r A list.
  • signals ()

    Returns signal metadata for ScrolledWindow.

    • @r A list.

class: ScrolledWindow

[64:7] extends: object

Makes its child scrollable. An example GtkScrolledWindow It does so 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 [iface@Gtk.Scrollable] interface, are added directly. For other types of widget, the class [class@Gtk.Viewport] acts as an adaptor, giving scrollability to other widgets. [method@Gtk.ScrolledWindow.set_child] intelligently accounts for whether or not the added child is a GtkScrollable. If it isn’t, then it wraps the child in a GtkViewport. Therefore, you can just add any child widget and not worry about the details. If [method@Gtk.ScrolledWindow.set_child] has added a GtkViewport for you, it will be automatically removed when you unset the child. Unless [property@Gtk.ScrolledWindow:hscrollbar-policy] and [property@Gtk.ScrolledWindow:vscrollbar-policy] are %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 [property@Gtk.ScrolledWindow:hadjustment] and [property@Gtk.ScrolledWindow:vadjustment] that are associated with the GtkScrolledWindow. See the docs on [class@Gtk.Scrollbar] 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 [property@Gtk.ScrolledWindow: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 [signal@Gtk.ScrolledWindow::edge-overshot] signal. If no mouse device is present, the scrollbars will overlaid 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 [property@Gtk.ScrolledWindow:overlay-scrolling] property. # Shortcuts and Gestures The following signals have default keybindings: - [signal@Gtk.ScrolledWindow::scroll-child] # CSS nodes GtkScrolledWindow has a main CSS node with name scrolledwindow. It gets a .frame style class added when [property@Gtk.ScrolledWindow:has-frame] is %TRUE. 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. # Accessibility Until GTK 4.10, GtkScrolledWindow used the [enum@Gtk.AccessibleRole.group] role. Starting from GTK 4.12, GtkScrolledWindow uses the [enum@Gtk.AccessibleRole.generic] role.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ScrolledWindow ()

    Creates a new scrolled window.

  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asWidget ()

    Wraps this handle as Widget.

    • @r A Widget object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnEdgeovershot (callback Fn, UserData = null)

    Emitted whenever user initiated scrolling makes the scrolled window firmly surpass the limits defined by the adjustment in that orientation. A similar behavior without edge resistance is provided by the [signal@Gtk.ScrolledWindow::edge-reached] signal. Note: The @pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ScrolledWindow Self, string Pos).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnEdgereached (callback Fn, UserData = null)

    Emitted whenever user-initiated scrolling makes the scrolled window exactly reach the lower or upper limits defined by the adjustment in that orientation. A similar behavior with edge resistance is provided by the [signal@Gtk.ScrolledWindow::edge-overshot] signal. Note: The @pos argument is LTR/RTL aware, so callers should be aware too if intending to provide behavior on horizontal edges.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ScrolledWindow Self, string Pos).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnMovefocusout (callback Fn, UserData = null)

    Emitted when focus is moved away from the scrolled window by a keybinding. This is a keybinding signal. The default bindings for this signal are Ctrl+Tab to move forward and Ctrl+Shift+Tab` to move backward.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ScrolledWindow Self, string Direction_type).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnScrollchild (callback Fn, UserData = null)

    Emitted when a keybinding that scrolls is pressed. This is a keybinding signal. The horizontal or vertical adjustment is updated which triggers a signal that the scrolled window’s child may listen to and scroll itself.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (ScrolledWindow Self, string Scroll, bool Horizontal).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setChild (object Value)

    The child widget. When setting this property, if the child widget does not implement [iface@Gtk.Scrollable], the scrolled window will add the child to a [class@Gtk.Viewport] and then set the viewport as the child.

    • @p Value is the new property value.
    • @r None.
  • setHadjustment (object Value)

    The GtkAdjustment for the horizontal position.

    • @p Value is the new property value.
    • @r None.
  • setHasframe (bool Value)

    Whether to draw a frame around the contents.

    • @p Value is the new property value.
    • @r None.
  • setHscrollbarpolicy (string Value)

    When the horizontal scrollbar is displayed. Use [method@Gtk.ScrolledWindow.set_policy] to set this property.

    • @p Value is the new property value.
    • @r None.
  • setKineticscrolling (bool Value)

    Whether kinetic scrolling is enabled or not. Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.

    • @p Value is the new property value.
    • @r None.
  • setMaxcontentheight (int Value)

    The maximum content height of @scrolled_window.

    • @p Value is the new property value.
    • @r None.
  • setMaxcontentwidth (int Value)

    The maximum content width of @scrolled_window.

    • @p Value is the new property value.
    • @r None.
  • setMincontentheight (int Value)

    The minimum content height of @scrolled_window.

    • @p Value is the new property value.
    • @r None.
  • setMincontentwidth (int Value)

    The minimum content width of @scrolled_window.

    • @p Value is the new property value.
    • @r None.
  • setOverlayscrolling (bool Value)

    Whether overlay scrolling is enabled or not. If it is, the scrollbars are only added as traditional widgets when a mouse is present. Otherwise, they are overlaid on top of the content, as narrow indicators. Note that overlay scrolling can also be globally disabled, with the [property@Gtk.Settings:gtk-overlay-scrolling] setting.

    • @p Value is the new property value.
    • @r None.
  • setPropagatenaturalheight (bool Value)

    Whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height. This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.

    • @p Value is the new property value.
    • @r None.
  • setPropagatenaturalwidth (bool Value)

    Whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width. This is useful in cases where an attempt should be made to allocate exactly enough space for the natural size of the child.

    • @p Value is the new property value.
    • @r None.
  • setVadjustment (object Value)

    The GtkAdjustment for the vertical position.

    • @p Value is the new property value.
    • @r None.
  • setVscrollbarpolicy (string Value)

    When the vertical scrollbar is displayed. Use [method@Gtk.ScrolledWindow.set_policy] to set this property.

    • @p Value is the new property value.
    • @r None.
  • setWindowplacement (string Value)

    Where the contents are located with respect to the scrollbars.

    • @p Value is the new property value.
    • @r None.
  • get_child ()

    Gets the child widget of @scrolled_window. If the scrolled window automatically added a [class@Gtk.Viewport], this function will return the viewport widget, and you can retrieve its child using [method@Gtk.Viewport.get_child].

  • get_hadjustment ()

    Returns the horizontal scrollbar’s adjustment. This is the adjustment used to connect the horizontal scrollbar to the child widget’s horizontal scroll functionality.

  • get_has_frame ()

    Gets whether the scrolled window draws a frame.

  • get_hscrollbar ()

    Returns the horizontal scrollbar of @scrolled_window.

  • get_kinetic_scrolling ()

    Returns the specified kinetic scrolling behavior.

  • get_max_content_height ()

    Returns the maximum content height set.

  • get_max_content_width ()

    Returns the maximum content width set.

  • get_min_content_height ()

    Gets the minimal content height of @scrolled_window.

  • get_min_content_width ()

    Gets the minimum content width of @scrolled_window.

  • get_overlay_scrolling ()

    Returns whether overlay scrolling is enabled for this scrolled window.

  • get_placement ()

    Gets the placement of the contents with respect to the scrollbars.

  • get_propagate_natural_height ()

    Reports whether the natural height of the child will be calculated and propagated through the scrolled window’s requested natural height.

  • get_propagate_natural_width ()

    Reports whether the natural width of the child will be calculated and propagated through the scrolled window’s requested natural width.

  • get_vadjustment ()

    Returns the vertical scrollbar’s adjustment. This is the adjustment used to connect the vertical scrollbar to the child widget’s vertical scroll functionality.

  • get_vscrollbar ()

    Returns the vertical scrollbar of @scrolled_window.

  • set_child (object child)

    Sets the child widget of @scrolled_window. If @child does not implement the [iface@Gtk.Scrollable] interface, the scrolled window will add @child to a [class@Gtk.Viewport] instance and then add the viewport as its child widget.

    • @p child is the child widget.
    • @r None.
  • set_hadjustment (object hadjustment)

    Sets the GtkAdjustment for the horizontal scrollbar.

    • @p hadjustment is the GtkAdjustment to use, or %NULL to create a new one.
    • @r None.
  • set_has_frame (bool has_frame)

    Changes the frame drawn around the contents of @scrolled_window.

    • @p has_frame is whether to draw a frame around scrolled window contents.
    • @r None.
  • set_kinetic_scrolling (bool kinetic_scrolling)

    Turns kinetic scrolling on or off. Kinetic scrolling only applies to devices with source %GDK_SOURCE_TOUCHSCREEN.

    • @p kinetic_scrolling is %TRUE to enable kinetic scrolling.
    • @r None.
  • set_max_content_height (int height)

    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. It is a programming error to set the maximum content height to a value smaller than [property@Gtk.ScrolledWindow:min-content-height].
    • @p height is the maximum content height.
    • @r None.
  • set_max_content_width (int width)

    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. It is a programming error to set the maximum content width to a value smaller than [property@Gtk.ScrolledWindow:min-content-width].
    • @p width is the maximum content width.
    • @r None.
  • set_min_content_height (int height)

    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. It is a programming error to set the minimum content height to a value greater than [property@Gtk.ScrolledWindow:max-content-height].

    • @p height is the minimal content height.
    • @r None.
  • set_min_content_width (int width)

    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. It is a programming error to set the minimum content width to a value greater than [property@Gtk.ScrolledWindow:max-content-width].

    • @p width is the minimal content width.
    • @r None.
  • set_overlay_scrolling (bool overlay_scrolling)

    Enables or disables overlay scrolling for this scrolled window.

    • @p overlay_scrolling is whether to enable overlay scrolling.
    • @r None.
  • set_placement (string window_placement)

    Sets the placement of the contents with respect to the scrollbars for the scrolled window. The default is %GTK_CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in [enum@Gtk.CornerType] are %GTK_CORNER_TOP_RIGHT, %GTK_CORNER_BOTTOM_LEFT, and %GTK_CORNER_BOTTOM_RIGHT. See also [method@Gtk.ScrolledWindow.get_placement] and [method@Gtk.ScrolledWindow.unset_placement].

    • @p window_placement is position of the child window.
    • @r None.
  • set_policy (string hscrollbar_policy, string vscrollbar_policy)

    Sets the scrollbar policy for the horizontal and vertical scrollbars. The policy determines when the scrollbar should appear; it is a value from the [enum@Gtk.PolicyType] enumeration. If %GTK_POLICY_ALWAYS, the scrollbar is always present; if %GTK_POLICY_NEVER, the scrollbar is never present; if %GTK_POLICY_AUTOMATIC, the scrollbar is present only if needed (that is, if the slider part of the bar would be smaller than the trough — the display is larger than the page size).

    • @p hscrollbar_policy is policy for horizontal bar.
    • @p vscrollbar_policy is policy for vertical bar.
    • @r None.
  • set_propagate_natural_height (bool propagate)

    Sets whether the natural height of the child should be calculated and propagated through the scrolled window’s requested natural height.

    • @p propagate is whether to propagate natural height.
    • @r None.
  • set_propagate_natural_width (bool propagate)

    Sets whether the natural width of the child should be calculated and propagated through the scrolled window’s requested natural width.

    • @p propagate is whether to propagate natural width.
    • @r None.
  • set_vadjustment (object vadjustment)

    Sets the GtkAdjustment for the vertical scrollbar.

    • @p vadjustment is the GtkAdjustment to use, or %NULL to create a new one.
    • @r None.
  • unset_placement ()

    Unsets the placement of the contents with respect to the scrollbars. If no window placement is set for a scrolled window, it defaults to %GTK_CORNER_TOP_LEFT.

    • @r None.

class: ScrolledWindowEdgereachedCallback

[941:7] extends: object

Generated low-level callback wrapper for GIR callback edge-reached.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ScrolledWindowEdgereachedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, pos, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ScrolledWindowMovefocusoutCallback

[1012:7] extends: object

Generated low-level callback wrapper for GIR callback move-focus-out.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ScrolledWindowMovefocusoutCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, direction_type, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: ScrolledWindowScrollchildCallback

[1083:7] extends: object

Generated low-level callback wrapper for GIR callback scroll-child.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ScrolledWindowScrollchildCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, scroll, horizontal, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.