CtkScrollbar: CTK+ 3 Reference Manual

## CtkScrollbar CtkScrollbar — A Scrollbar |

## Functions

CtkWidget * | ctk_scrollbar_new ()

## Types and Values

struct | CtkScrollbar

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── CtkWidget
                ╰── CtkRange
                    ╰── CtkScrollbar
                        ├── CtkHScrollbar
                        ╰── CtkVScrollbar

## Implemented Interfaces

CtkScrollbar implements AtkImplementorIface, CtkBuildable and CtkOrientable.

## Includes

    #include <ctk/ctk.h>

## Description

The CtkScrollbar widget is a horizontal or vertical scrollbar, depending on the value of the “orientation” property.

Its position and movement are controlled by the adjustment that is passed to or created by `ctk_scrollbar_new()`. See CtkAdjustment for more details. The “value” field sets the position of the thumb and must be between “lower” and “upper” - “page-size”. The “page-size” represents the size of the visible scrollable area. The fields “step-increment” and “page-increment” fields are added to or subtracted from the “value” when the user asks to move by a step (using e.g. the cursor arrow keys or, if present, the stepper buttons) or by a page (using e.g. the Page Down/Up keys).

### CSS nodes

    1
    2
    3
    4
    5
    6
    7
    8
    scrollbar[.fine-tune]
    ╰── contents
        ├── [button.up]
        ├── [button.down]
        ├── trough
        │   ╰── slider
        ├── [button.up]
        ╰── [button.down]

CtkScrollbar has a main CSS node with name scrollbar and a subnode for its contents, with subnodes named trough and slider.

The main node gets the style class .fine-tune added when the scrollbar is in 'fine-tuning' mode.

If steppers are enabled, they are represented by up to four additional subnodes with name button. These get the style classes .up and .down to indicate in which direction they are moving.

Other style classes that may be added to scrollbars inside CtkScrolledWindow include the positional classes (.left, .right, .top, .bottom) and style classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).

## Functions

### ctk_scrollbar_new ()

    CtkWidget *
    ctk_scrollbar_new (CtkOrientation orientation,
                       CtkAdjustment *adjustment);

Creates a new scrollbar with the given orientation.

#### Parameters

orientation | the scrollbar’s orientation. |
adjustment | the CtkAdjustment to use, or `NULL` to create a new adjustment. | [allow-none]

#### Returns

the new CtkScrollbar.

Since: 3.0

## Types and Values

### struct CtkScrollbar

    struct CtkScrollbar;

## See Also

CtkAdjustment, CtkScrolledWindow