CtkScrolledWindow

CtkScrolledWindow — Adds scrollbars to its child widget

Functions

CtkWidget * ctk_scrolled_window_new ()
CtkAdjustment * ctk_scrolled_window_get_hadjustment ()
void ctk_scrolled_window_set_hadjustment ()
CtkAdjustment * ctk_scrolled_window_get_vadjustment ()
void ctk_scrolled_window_set_vadjustment ()
CtkWidget * ctk_scrolled_window_get_hscrollbar ()
CtkWidget * ctk_scrolled_window_get_vscrollbar ()
void ctk_scrolled_window_get_policy ()
void ctk_scrolled_window_set_policy ()
void ctk_scrolled_window_add_with_viewport ()
CtkCornerType ctk_scrolled_window_get_placement ()
void ctk_scrolled_window_set_placement ()
void ctk_scrolled_window_unset_placement ()
CtkShadowType ctk_scrolled_window_get_shadow_type ()
void ctk_scrolled_window_set_shadow_type ()
gboolean ctk_scrolled_window_get_kinetic_scrolling ()
void ctk_scrolled_window_set_kinetic_scrolling ()
gboolean ctk_scrolled_window_get_capture_button_press ()
void ctk_scrolled_window_set_capture_button_press ()
gboolean ctk_scrolled_window_get_overlay_scrolling ()
void ctk_scrolled_window_set_overlay_scrolling ()
gint ctk_scrolled_window_get_min_content_width ()
void ctk_scrolled_window_set_min_content_width ()
gint ctk_scrolled_window_get_min_content_height ()
void ctk_scrolled_window_set_min_content_height ()
gint ctk_scrolled_window_get_max_content_width ()
void ctk_scrolled_window_set_max_content_width ()
gint ctk_scrolled_window_get_max_content_height ()
void ctk_scrolled_window_set_max_content_height ()
gboolean ctk_scrolled_window_get_propagate_natural_width ()
void ctk_scrolled_window_set_propagate_natural_width ()
gboolean ctk_scrolled_window_get_propagate_natural_height ()
void ctk_scrolled_window_set_propagate_natural_height ()

Properties

CtkAdjustment * hadjustment Read / Write / Construct
CtkPolicyType hscrollbar-policy Read / Write
gboolean kinetic-scrolling Read / Write
int max-content-height Read / Write
int max-content-width Read / Write
int min-content-height Read / Write
int min-content-width Read / Write
gboolean overlay-scrolling Read / Write
gboolean propagate-natural-height Read / Write
gboolean propagate-natural-width Read / Write
CtkShadowType shadow-type Read / Write
CtkAdjustment * vadjustment Read / Write / Construct
CtkPolicyType vscrollbar-policy Read / Write
CtkCornerType window-placement Read / Write
gboolean window-placement-set Read / Write

Signals

void edge-overshot Run Last
void edge-reached Run Last
void move-focus-out Action
gboolean scroll-child Action

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBin
                    ╰── CtkScrolledWindow
                        ╰── CtkPlacesSidebar

Implemented Interfaces

CtkScrolledWindow implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

CtkScrolledWindow 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 CtkScrollable interface, are added directly. For other types of widget, the class CtkViewport acts as an adaptor, giving scrollability to other widgets. CtkScrolledWindow’s implementation of ctk_container_add() intelligently accounts for whether or not the added child is a CtkScrollable. If it isn’t, CtkScrolledWindow wraps the child in a CtkViewport and adds that for you. Therefore, you can just add any child widget and not worry about the details.

If ctk_container_add() has added a CtkViewport for you, you can remove both your added child widget from the CtkViewport, and the CtkViewport from the CtkScrolledWindow, like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CtkWidget *scrolled_window = ctk_scrolled_window_new (NULL, NULL);
CtkWidget *child_widget = ctk_button_new ();

// CtkButton is not a CtkScrollable, so CtkScrolledWindow will automatically
// add a CtkViewport.
ctk_container_add (CTK_CONTAINER (scrolled_window),
                   child_widget);

// Either of these will result in child_widget being unparented:
ctk_container_remove (CTK_CONTAINER (scrolled_window),
                      child_widget);
// or
ctk_container_remove (CTK_CONTAINER (scrolled_window),
                      ctk_bin_get_child (CTK_BIN (scrolled_window)));

Unless “policy” is CTK_POLICY_NEVER or CTK_POLICY_EXTERNAL, CtkScrolledWindow adds internal CtkScrollbar widgets around its child. The scroll position of the child, and if applicable the scrollbars, is controlled by the “hadjustment” and “vadjustment” that are associated with the CtkScrolledWindow. See the docs on CtkScrollbar 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 CtkScrolledWindow 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 CtkScrollbar and for example a CtkGrid.

Touch support

CtkScrolledWindow 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 “kinetic-scrolling” property if it is undesired.

CtkScrolledWindow also displays visual 'overshoot' indication when the content is pulled beyond the end, and this situation can be captured with the “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 “overlay-scrolling” property.


CSS nodes

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

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

Functions

ctk_scrolled_window_new ()

CtkWidget *
ctk_scrolled_window_new (CtkAdjustment *hadjustment,
                         CtkAdjustment *vadjustment);

Creates a new scrolled window.

The two arguments are the scrolled window’s adjustments; these will be shared with the scrollbars and the child widget to keep the bars in sync with the child. Usually you want to pass NULL for the adjustments, which will cause the scrolled window to create them for you.

Parameters

hadjustment

horizontal adjustment.

[nullable]

vadjustment

vertical adjustment.

[nullable]

Returns

a new scrolled window


ctk_scrolled_window_get_hadjustment ()

CtkAdjustment *
ctk_scrolled_window_get_hadjustment (CtkScrolledWindow *scrolled_window);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the horizontal CtkAdjustment.

[transfer none]


ctk_scrolled_window_set_hadjustment ()

void
ctk_scrolled_window_set_hadjustment (CtkScrolledWindow *scrolled_window,
                                     CtkAdjustment *hadjustment);

Sets the CtkAdjustment for the horizontal scrollbar.

Parameters

scrolled_window

a CtkScrolledWindow

 

hadjustment

the CtkAdjustment to use, or NULL to create a new one.

[nullable]

ctk_scrolled_window_get_vadjustment ()

CtkAdjustment *
ctk_scrolled_window_get_vadjustment (CtkScrolledWindow *scrolled_window);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the vertical CtkAdjustment.

[transfer none]


ctk_scrolled_window_set_vadjustment ()

void
ctk_scrolled_window_set_vadjustment (CtkScrolledWindow *scrolled_window,
                                     CtkAdjustment *vadjustment);

Sets the CtkAdjustment for the vertical scrollbar.

Parameters

scrolled_window

a CtkScrolledWindow

 

vadjustment

the CtkAdjustment to use, or NULL to create a new one.

[nullable]

ctk_scrolled_window_get_hscrollbar ()

CtkWidget *
ctk_scrolled_window_get_hscrollbar (CtkScrolledWindow *scrolled_window);

Returns the horizontal scrollbar of scrolled_window .

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the horizontal scrollbar of the scrolled window.

[transfer none]

Since: 2.8


ctk_scrolled_window_get_vscrollbar ()

CtkWidget *
ctk_scrolled_window_get_vscrollbar (CtkScrolledWindow *scrolled_window);

Returns the vertical scrollbar of scrolled_window .

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the vertical scrollbar of the scrolled window.

[transfer none]

Since: 2.8


ctk_scrolled_window_get_policy ()

void
ctk_scrolled_window_get_policy (CtkScrolledWindow *scrolled_window,
                                CtkPolicyType *hscrollbar_policy,
                                CtkPolicyType *vscrollbar_policy);

Retrieves the current policy values for the horizontal and vertical scrollbars. See ctk_scrolled_window_set_policy().

Parameters

scrolled_window

a CtkScrolledWindow

 

hscrollbar_policy

location to store the policy for the horizontal scrollbar, or NULL.

[out][optional]

vscrollbar_policy

location to store the policy for the vertical scrollbar, or NULL.

[out][optional]

ctk_scrolled_window_set_policy ()

void
ctk_scrolled_window_set_policy (CtkScrolledWindow *scrolled_window,
                                CtkPolicyType hscrollbar_policy,
                                CtkPolicyType 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 CtkPolicyType enumeration. If CTK_POLICY_ALWAYS, the scrollbar is always present; if CTK_POLICY_NEVER, the scrollbar is never present; if CTK_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).

Parameters

scrolled_window

a CtkScrolledWindow

 

hscrollbar_policy

policy for horizontal bar

 

vscrollbar_policy

policy for vertical bar

 

ctk_scrolled_window_add_with_viewport ()

void
ctk_scrolled_window_add_with_viewport (CtkScrolledWindow *scrolled_window,
                                       CtkWidget *child);

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 ctk_container_add() instead of this function.

The viewport scrolls the child by moving its CdkWindow, and takes the size of the child to be the size of its toplevel CdkWindow. This will be very wrong for most widgets that support native scrolling; for example, if you add a widget such as CtkTreeView with a viewport, the whole widget will scroll, including the column headings. Thus, widgets with native scrolling support should not be used with the CtkViewport proxy.

A widget supports scrolling natively if it implements the CtkScrollable interface.

Parameters

scrolled_window

a CtkScrolledWindow

 

child

the widget you want to scroll

 

ctk_scrolled_window_get_placement ()

CtkCornerType
ctk_scrolled_window_get_placement (CtkScrolledWindow *scrolled_window);

Gets the placement of the contents with respect to the scrollbars for the scrolled window. See ctk_scrolled_window_set_placement().

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the current placement value.

See also ctk_scrolled_window_set_placement() and ctk_scrolled_window_unset_placement().


ctk_scrolled_window_set_placement ()

void
ctk_scrolled_window_set_placement (CtkScrolledWindow *scrolled_window,
                                   CtkCornerType window_placement);

Sets the placement of the contents with respect to the scrollbars for the scrolled window.

The default is CTK_CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in CtkCornerType are CTK_CORNER_TOP_RIGHT, CTK_CORNER_BOTTOM_LEFT, and CTK_CORNER_BOTTOM_RIGHT.

See also ctk_scrolled_window_get_placement() and ctk_scrolled_window_unset_placement().

Parameters

scrolled_window

a CtkScrolledWindow

 

window_placement

position of the child window

 

ctk_scrolled_window_unset_placement ()

void
ctk_scrolled_window_unset_placement (CtkScrolledWindow *scrolled_window);

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

See also ctk_scrolled_window_set_placement() and ctk_scrolled_window_get_placement().

Parameters

scrolled_window

a CtkScrolledWindow

 

Since: 2.10


ctk_scrolled_window_get_shadow_type ()

CtkShadowType
ctk_scrolled_window_get_shadow_type (CtkScrolledWindow *scrolled_window);

Gets the shadow type of the scrolled window. See ctk_scrolled_window_set_shadow_type().

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the current shadow type


ctk_scrolled_window_set_shadow_type ()

void
ctk_scrolled_window_set_shadow_type (CtkScrolledWindow *scrolled_window,
                                     CtkShadowType type);

Changes the type of shadow drawn around the contents of scrolled_window .

Parameters

scrolled_window

a CtkScrolledWindow

 

type

kind of shadow to draw around scrolled window contents

 

ctk_scrolled_window_get_kinetic_scrolling ()

gboolean
ctk_scrolled_window_get_kinetic_scrolling
                               (CtkScrolledWindow *scrolled_window);

Returns the specified kinetic scrolling behavior.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the scrolling behavior flags.

Since: 3.4


ctk_scrolled_window_set_kinetic_scrolling ()

void
ctk_scrolled_window_set_kinetic_scrolling
                               (CtkScrolledWindow *scrolled_window,
                                gboolean kinetic_scrolling);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

kinetic_scrolling

TRUE to enable kinetic scrolling

 

Since: 3.4


ctk_scrolled_window_get_capture_button_press ()

gboolean
ctk_scrolled_window_get_capture_button_press
                               (CtkScrolledWindow *scrolled_window);

Return whether button presses are captured during kinetic scrolling. See ctk_scrolled_window_set_capture_button_press().

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

TRUE if button presses are captured during kinetic scrolling

Since: 3.4


ctk_scrolled_window_set_capture_button_press ()

void
ctk_scrolled_window_set_capture_button_press
                               (CtkScrolledWindow *scrolled_window,
                                gboolean capture_button_press);

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.

This should be enabled if any child widgets perform non-reversible actions on “button-press-event”. If they don't, and handle additionally handle “grab-broken-event”, it might be better to set capture_button_press to FALSE.

This setting only has an effect if kinetic scrolling is enabled.

Parameters

scrolled_window

a CtkScrolledWindow

 

capture_button_press

TRUE to capture button presses

 

Since: 3.4


ctk_scrolled_window_get_overlay_scrolling ()

gboolean
ctk_scrolled_window_get_overlay_scrolling
                               (CtkScrolledWindow *scrolled_window);

Returns whether overlay scrolling is enabled for this scrolled window.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

TRUE if overlay scrolling is enabled

Since: 3.16


ctk_scrolled_window_set_overlay_scrolling ()

void
ctk_scrolled_window_set_overlay_scrolling
                               (CtkScrolledWindow *scrolled_window,
                                gboolean overlay_scrolling);

Enables or disables overlay scrolling for this scrolled window.

Parameters

scrolled_window

a CtkScrolledWindow

 

overlay_scrolling

whether to enable overlay scrolling

 

Since: 3.16


ctk_scrolled_window_get_min_content_width ()

gint
ctk_scrolled_window_get_min_content_width
                               (CtkScrolledWindow *scrolled_window);

Gets the minimum content width of scrolled_window , or -1 if not set.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the minimum content width

Since: 3.0


ctk_scrolled_window_set_min_content_width ()

void
ctk_scrolled_window_set_min_content_width
                               (CtkScrolledWindow *scrolled_window,
                                gint 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 “max-content-width”.

Parameters

scrolled_window

a CtkScrolledWindow

 

width

the minimal content width

 

Since: 3.0


ctk_scrolled_window_get_min_content_height ()

gint
ctk_scrolled_window_get_min_content_height
                               (CtkScrolledWindow *scrolled_window);

Gets the minimal content height of scrolled_window , or -1 if not set.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the minimal content height

Since: 3.0


ctk_scrolled_window_set_min_content_height ()

void
ctk_scrolled_window_set_min_content_height
                               (CtkScrolledWindow *scrolled_window,
                                gint 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 “max-content-height”.

Parameters

scrolled_window

a CtkScrolledWindow

 

height

the minimal content height

 

Since: 3.0


ctk_scrolled_window_get_max_content_width ()

gint
ctk_scrolled_window_get_max_content_width
                               (CtkScrolledWindow *scrolled_window);

Returns the maximum content width set.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the maximum content width, or -1

Since: 3.22


ctk_scrolled_window_set_max_content_width ()

void
ctk_scrolled_window_set_max_content_width
                               (CtkScrolledWindow *scrolled_window,
                                gint 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 “min-content-width”.

Parameters

scrolled_window

a CtkScrolledWindow

 

width

the maximum content width

 

Since: 3.22


ctk_scrolled_window_get_max_content_height ()

gint
ctk_scrolled_window_get_max_content_height
                               (CtkScrolledWindow *scrolled_window);

Returns the maximum content height set.

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

the maximum content height, or -1

Since: 3.22


ctk_scrolled_window_set_max_content_height ()

void
ctk_scrolled_window_set_max_content_height
                               (CtkScrolledWindow *scrolled_window,
                                gint 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 “min-content-height”.

Parameters

scrolled_window

a CtkScrolledWindow

 

height

the maximum content height

 

Since: 3.22


ctk_scrolled_window_get_propagate_natural_width ()

gboolean
ctk_scrolled_window_get_propagate_natural_width
                               (CtkScrolledWindow *scrolled_window);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

whether natural width propagation is enabled.

Since: 3.22


ctk_scrolled_window_set_propagate_natural_width ()

void
ctk_scrolled_window_set_propagate_natural_width
                               (CtkScrolledWindow *scrolled_window,
                                gboolean propagate);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

propagate

whether to propagate natural width

 

Since: 3.22


ctk_scrolled_window_get_propagate_natural_height ()

gboolean
ctk_scrolled_window_get_propagate_natural_height
                               (CtkScrolledWindow *scrolled_window);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

Returns

whether natural height propagation is enabled.

Since: 3.22


ctk_scrolled_window_set_propagate_natural_height ()

void
ctk_scrolled_window_set_propagate_natural_height
                               (CtkScrolledWindow *scrolled_window,
                                gboolean propagate);

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

Parameters

scrolled_window

a CtkScrolledWindow

 

propagate

whether to propagate natural height

 

Since: 3.22

Types and Values

struct CtkScrolledWindow

struct CtkScrolledWindow;

struct CtkScrolledWindowClass

struct CtkScrolledWindowClass {
  CtkBinClass parent_class;

  gint scrollbar_spacing;

  /* Action signals for keybindings. Do not connect to these signals
   */

  /* Unfortunately, CtkScrollType is deficient in that there is
   * no horizontal/vertical variants for CTK_SCROLL_START/END,
   * so we have to add an additional boolean flag.
   */
  gboolean (*scroll_child) (CtkScrolledWindow *scrolled_window,
	  		    CtkScrollType      scroll,
			    gboolean           horizontal);

  void (* move_focus_out) (CtkScrolledWindow *scrolled_window,
			   CtkDirectionType   direction);
};

Members

gint scrollbar_spacing;

   

scroll_child ()

Keybinding signal which gets emitted when a keybinding that scrolls is pressed.

 

move_focus_out ()

Keybinding signal which gets emitted when focus is moved away from the scrolled window by a keybinding.

 

enum CtkPolicyType

Determines how the size should be computed to achieve the one of the visibility mode for the scrollbars.

Members

CTK_POLICY_ALWAYS

The scrollbar is always visible. The view size is independent of the content.

 

CTK_POLICY_AUTOMATIC

The scrollbar will appear and disappear as necessary. For example, when all of a CtkTreeView can not be seen.

 

CTK_POLICY_NEVER

The scrollbar should never appear. In this mode the content determines the size.

 

CTK_POLICY_EXTERNAL

Don't show a scrollbar, but don't force the size to follow the content. This can be used e.g. to make multiple scrolled windows share a scrollbar. Since: 3.16

 

enum CtkCornerType

Specifies which corner a child widget should be placed in when packed into a CtkScrolledWindow. This is effectively the opposite of where the scroll bars are placed.

Members

CTK_CORNER_TOP_LEFT

Place the scrollbars on the right and bottom of the widget (default behaviour).

 

CTK_CORNER_BOTTOM_LEFT

Place the scrollbars on the top and right of the widget.

 

CTK_CORNER_TOP_RIGHT

Place the scrollbars on the left and bottom of the widget.

 

CTK_CORNER_BOTTOM_RIGHT

Place the scrollbars on the top and left of the widget.

 

Property Details

The “hadjustment” property

  “hadjustment”              CtkAdjustment *

The CtkAdjustment for the horizontal position.

Owner: CtkScrolledWindow

Flags: Read / Write / Construct


The “hscrollbar-policy” property

  “hscrollbar-policy”        CtkPolicyType

When the horizontal scrollbar is displayed.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: CTK_POLICY_AUTOMATIC


The “kinetic-scrolling” property

  “kinetic-scrolling”        gboolean

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

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: TRUE

Since: 3.4


The “max-content-height” property

  “max-content-height”       int

The maximum content height of scrolled_window , or -1 if not set.

Owner: CtkScrolledWindow

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 3.22


The “max-content-width” property

  “max-content-width”        int

The maximum content width of scrolled_window , or -1 if not set.

Owner: CtkScrolledWindow

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 3.22


The “min-content-height” property

  “min-content-height”       int

The minimum content height of scrolled_window , or -1 if not set.

Owner: CtkScrolledWindow

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 3.0


The “min-content-width” property

  “min-content-width”        int

The minimum content width of scrolled_window , or -1 if not set.

Owner: CtkScrolledWindow

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 3.0


The “overlay-scrolling” property

  “overlay-scrolling”        gboolean

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 overlayed on top of the content, as narrow indicators.

Note that overlay scrolling can also be globally disabled, with the “ctk-overlay-scrolling” setting.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: TRUE

Since: 3.16


The “propagate-natural-height” property

  “propagate-natural-height” gboolean

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.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: FALSE

Since: 3.22


The “propagate-natural-width” property

  “propagate-natural-width”  gboolean

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.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: FALSE

Since: 3.22


The “shadow-type” property

  “shadow-type”              CtkShadowType

Style of bevel around the contents.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: CTK_SHADOW_NONE


The “vadjustment” property

  “vadjustment”              CtkAdjustment *

The CtkAdjustment for the vertical position.

Owner: CtkScrolledWindow

Flags: Read / Write / Construct


The “vscrollbar-policy” property

  “vscrollbar-policy”        CtkPolicyType

When the vertical scrollbar is displayed.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: CTK_POLICY_AUTOMATIC


The “window-placement” property

  “window-placement”         CtkCornerType

Where the contents are located with respect to the scrollbars.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: CTK_CORNER_TOP_LEFT


The “window-placement-set” property

  “window-placement-set”     gboolean

Whether "window-placement" should be used to determine the location of the contents with respect to the scrollbars.

CtkScrolledWindow:window-placement-set has been deprecated since version 3.10 and should not be used in newly-written code.

This value is ignored and “window-placement” value is always honored.

Owner: CtkScrolledWindow

Flags: Read / Write

Default value: TRUE

Since: 2.10

Signal Details

The “edge-overshot” signal

void
user_function (CtkScrolledWindow *scrolled_window,
               CtkPositionType    pos,
               gpointer           user_data)

The ::edge-overshot signal is emitted whenever user initiated scrolling makes the scrolled window firmly surpass (i.e. with some edge resistance) the lower or upper limits defined by the adjustment in that orientation.

A similar behavior without edge resistance is provided by the “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.

Parameters

scrolled_window

a CtkScrolledWindow

 

pos

edge side that was hit

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.16


The “edge-reached” signal

void
user_function (CtkScrolledWindow *scrolled_window,
               CtkPositionType    pos,
               gpointer           user_data)

The ::edge-reached signal is 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 “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.

Parameters

scrolled_window

a CtkScrolledWindow

 

pos

edge side that was reached

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.16


The “move-focus-out” signal

void
user_function (CtkScrolledWindow *scrolled_window,
               CtkDirectionType   direction_type,
               gpointer           user_data)

The ::move-focus-out signal is a keybinding signal which gets emitted when focus is moved away from the scrolled window by a keybinding. The “move-focus” signal is emitted with direction_type on this scrolled window’s toplevel parent in the container hierarchy. The default bindings for this signal are Ctrl + Tab to move forward and Ctrl + Shift + Tab to move backward.

Parameters

scrolled_window

a CtkScrolledWindow

 

direction_type

either CTK_DIR_TAB_FORWARD or CTK_DIR_TAB_BACKWARD

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “scroll-child” signal

gboolean
user_function (CtkScrolledWindow *scrolled_window,
               CtkScrollType      scroll,
               gboolean           horizontal,
               gpointer           user_data)

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

Parameters

scrolled_window

a CtkScrolledWindow

 

scroll

a CtkScrollType describing how much to scroll

 

horizontal

whether the keybinding scrolls the child horizontally or not

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

See Also

CtkScrollable, CtkViewport, CtkAdjustment