Gtk.Scrollable

const Gtk = imports.gi.Gtk;

let scrollable = new Gtk.Scrollable({
    hadjustment: value,
    hscroll_policy: value,
    vadjustment: value,
    vscroll_policy: value,
});
  

Gtk.Scrollable is an interface that is implemented by widgets with native scrolling ability.

To implement this interface you should override the Gtk.hadjustment and Gtk.vadjustment properties.

<refsect2> <title>Creating a scrollable widget</title> <para> All scrollable widgets should do the following.

<orderedlist> <listitem> <para> When a parent widget sets the scrollable child widget's adjustments, the widget should populate the adjustments' Gtk.Adjustment:lower, Gtk.Adjustment:upper, Gtk.Adjustment:step-increment, Gtk.Adjustment:page-increment and Gtk.Adjustment:page-size properties and connect to the Gtk.Adjustment::value-changed signal. </para> </listitem> <listitem> <para> Because its preferred size is the size for a fully expanded widget, the scrollable widget must be able to cope with underallocations. This means that it must accept any value passed to its Gtk.WidgetClass.size_allocate() function. </para> </listitem> <listitem> <para> When the parent allocates space to the scrollable child widget, the widget should update the adjustments' properties with new values. </para> </listitem> <listitem> <para> When any of the adjustments emits the Gtk.Adjustment::value-changed signal, the scrollable widget should scroll its contents. </para> </listitem> </orderedlist> </para> </refsect2>

Hierarchy

  • Gtk.Scrollable