Gtk.Scrollable


Gtk.Scrollable — An interface for scrollable widgets

Object Hierarchy:

    GInterface
    ╰── Gtk.Scrollable

Functions:

Description:

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

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

Creating a scrollable widget

All scrollable widgets should do the following.

When a parent widget sets the scrollable child widget’s adjustments, the widget should populate the adjustments’ “lower”, “upper”, “step-increment”, “page-increment” and “page-size” properties and connect to the “value-changed” signal.

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 GtkWidgetClass.size_allocate() function.

When the parent allocates space to the scrollable child widget, the widget should update the adjustments’ properties with new values.

When any of the adjustments emits the “value-changed” signal, the scrollable widget should scroll its contents.


Function Details:

get_hadjustment()

get_hadjustment (self) -> Gtk.Adjustment

Retrieves the Gtk.Adjustment used for horizontal scrolling.

  • Returns: horizontal Gtk.Adjustment.

  • Since: 3.0


set_hadjustment()

set_hadjustment (self, hadjustment:Gtk.Adjustment=None)

Sets the horizontal adjustment of the Gtk.Scrollable.

  • Since: 3.0

get_vadjustment()

get_vadjustment (self) -> Gtk.Adjustment

Retrieves the Gtk.Adjustment used for vertical scrolling.

  • Returns: vertical Gtk.Adjustment.

  • Since: 3.0


set_vadjustment()

set_vadjustment (self, vadjustment:Gtk.Adjustment=None)

Sets the vertical adjustment of the Gtk.Scrollable.

  • Since: 3.0

get_hscroll_policy()

get_hscroll_policy (self) -> Gtk.ScrollablePolicy

Gets the horizontal Gtk.ScrollablePolicy.

  • Returns: The horizontal Gtk.ScrollablePolicy.

  • Since: 3.0


set_hscroll_policy()

set_hscroll_policy (self, policy:Gtk.ScrollablePolicy)

Sets the Gtk.ScrollablePolicy to determine whetherhorizontal scrolling should start below the minimum width orbelow the natural width.

  • Since: 3.0

get_vscroll_policy()

get_vscroll_policy (self) -> Gtk.ScrollablePolicy

Gets the vertical Gtk.ScrollablePolicy.

  • Returns: The vertical Gtk.ScrollablePolicy.

  • Since: 3.0


set_vscroll_policy()

set_vscroll_policy (self, policy:Gtk.ScrollablePolicy)

Sets the Gtk.ScrollablePolicy to determine whethervertical scrolling should start below the minimum height orbelow the natural height.

  • Since: 3.0

get_border()

get_border (self, border:Gtk.Border) -> bool

Returns the size of a non-scrolling border around theoutside of the scrollable. An example for this wouldbe treeview headers. GTK+ can use this information todisplay overlayed graphics, like the overshoot indication,at the right position.

  • Returns: True if borderhas been set

  • Since: 3.16


results matching ""

    No results matching ""