<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkScrollbar">
<refmeta>
<refentrytitle role="top_of_page" id="GtkScrollbar.top_of_page">GtkScrollbar</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkScrollbar</refname>
<refpurpose>A Scrollbar</refpurpose>
</refnamediv>

<refsect1 id="GtkScrollbar.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-scrollbar-new">gtk_scrollbar_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkAdjustment"><returnvalue>GtkAdjustment</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-scrollbar-get-adjustment">gtk_scrollbar_get_adjustment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-scrollbar-set-adjustment">gtk_scrollbar_set_adjustment</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScrollbar.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GtkAdjustment"><type>GtkAdjustment</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkScrollbar--adjustment">adjustment</link></entry><entry role="property_flags">Read / Write / Construct</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScrollbar.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkScrollbar-struct">GtkScrollbar</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkScrollbar.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkScrollbar
</screen>
</refsect1>
<refsect1 id="GtkScrollbar.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkScrollbar implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link>,  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link> and  <link linkend="GtkOrientable">GtkOrientable</link>.</para>

</refsect1>

<refsect1 id="GtkScrollbar.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkScrollbar.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GtkScrollbar"><type>GtkScrollbar</type></link> widget is a horizontal or vertical scrollbar,
depending on the value of the <link linkend="GtkOrientable--orientation"><type>“orientation”</type></link> property.</para>
<para>Its position and movement are controlled by the adjustment that is passed to
or created by <link linkend="gtk-scrollbar-new"><function>gtk_scrollbar_new()</function></link>. See <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> for more details. The
<link linkend="GtkAdjustment--value"><type>“value”</type></link> field sets the position of the thumb and must be between
<link linkend="GtkAdjustment--lower"><type>“lower”</type></link> and <link linkend="GtkAdjustment--upper"><type>“upper”</type></link> - <link linkend="GtkAdjustment--page-size"><type>“page-size”</type></link>. The
<link linkend="GtkAdjustment--page-size"><type>“page-size”</type></link> represents the size of the visible scrollable area.
The fields <link linkend="GtkAdjustment--step-increment"><type>“step-increment”</type></link> and <link linkend="GtkAdjustment--page-increment"><type>“page-increment”</type></link>
fields are added to or subtracted from the <link linkend="GtkAdjustment--value"><type>“value”</type></link> 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).</para>
<refsect2><title>CSS nodes</title><informalexample><programlisting role="example"><![CDATA[
scrollbar
╰── range[.fine-tune]
    ╰── trough
        ╰── slider
]]></programlisting></informalexample>
<para></para>
<para>GtkScrollbar has a main CSS node with name scrollbar and a subnode for its
contents. The main node gets the .horizontal or .vertical
style classes applied, depending on the scrollbar's orientation.</para>
<para>The range node gets the style class .fine-tune added when the scrollbar is
in 'fine-tuning' mode.</para>
<para>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.</para>
<para>Other style classes that may be added to scrollbars inside <link linkend="GtkScrolledWindow"><type>GtkScrolledWindow</type></link>
include the positional classes (.left, .right, .top, .bottom) and style
classes related to overlay scrolling (.overlay-indicator, .dragging, .hovering).</para>
</refsect2>

</refsect1>
<refsect1 id="GtkScrollbar.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-scrollbar-new" role="function">
<title>gtk_scrollbar_new&#160;()</title>
<indexterm zone="gtk-scrollbar-new"><primary>gtk_scrollbar_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_scrollbar_new (<parameter><link linkend="GtkOrientation"><type>GtkOrientation</type></link> orientation</parameter>,
                   <parameter><link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> *adjustment</parameter>);</programlisting>
<para>Creates a new scrollbar with the given orientation.</para>
<refsect3 id="gtk-scrollbar-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>orientation</para></entry>
<entry role="parameter_description"><para>the scrollbar’s orientation.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>adjustment</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> to use, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to create a new adjustment. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scrollbar-new.returns" role="returns">
<title>Returns</title>
<para>  the new <link linkend="GtkScrollbar"><type>GtkScrollbar</type></link>.</para>
</refsect3></refsect2>
<refsect2 id="gtk-scrollbar-get-adjustment" role="function">
<title>gtk_scrollbar_get_adjustment&#160;()</title>
<indexterm zone="gtk-scrollbar-get-adjustment"><primary>gtk_scrollbar_get_adjustment</primary></indexterm>
<programlisting language="C"><link linkend="GtkAdjustment"><returnvalue>GtkAdjustment</returnvalue></link>&#160;*
gtk_scrollbar_get_adjustment (<parameter><link linkend="GtkScrollbar"><type>GtkScrollbar</type></link> *self</parameter>);</programlisting>
<para>Returns the scrollbar's adjustment.</para>
<refsect3 id="gtk-scrollbar-get-adjustment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScrollbar"><type>GtkScrollbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-scrollbar-get-adjustment.returns" role="returns">
<title>Returns</title>
<para>the scrollbar's adjustment. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-scrollbar-set-adjustment" role="function">
<title>gtk_scrollbar_set_adjustment&#160;()</title>
<indexterm zone="gtk-scrollbar-set-adjustment"><primary>gtk_scrollbar_set_adjustment</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_scrollbar_set_adjustment (<parameter><link linkend="GtkScrollbar"><type>GtkScrollbar</type></link> *self</parameter>,
                              <parameter><link linkend="GtkAdjustment"><type>GtkAdjustment</type></link> *adjustment</parameter>);</programlisting>
<para>Makes the scrollbar use the given adjustment.</para>
<refsect3 id="gtk-scrollbar-set-adjustment.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkScrollbar"><type>GtkScrollbar</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>adjustment</para></entry>
<entry role="parameter_description"><para>the adjustment to set. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkScrollbar.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkScrollbar-struct" role="struct">
<title>GtkScrollbar</title>
<indexterm zone="GtkScrollbar-struct"><primary>GtkScrollbar</primary></indexterm>
<programlisting language="C">typedef struct _GtkScrollbar GtkScrollbar;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkScrollbar.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkScrollbar--adjustment" role="property"><title>The <literal>“adjustment”</literal> property</title>
<indexterm zone="GtkScrollbar--adjustment"><primary>GtkScrollbar:adjustment</primary></indexterm>
<programlisting>  “adjustment”               <link linkend="GtkAdjustment"><type>GtkAdjustment</type></link>&#160;*</programlisting>
<para>The GtkAdjustment that contains the current value of this scrollbar.</para><para>Owner: GtkScrollbar</para>
<para>Flags: Read / Write / Construct</para>
</refsect2>

</refsect1>
<refsect1 id="GtkScrollbar.see-also">
<title>See Also</title>
<para><link linkend="GtkAdjustment"><type>GtkAdjustment</type></link>, <link linkend="GtkScrolledWindow"><type>GtkScrolledWindow</type></link></para>

</refsect1>

</refentry>
