Gtk.Scrollable¶
- Implementations:
Gtk.ColumnView
,Gtk.IconView
,Gtk.ListBase
,Gtk.TextView
,Gtk.TreeView
,Gtk.Viewport
Methods¶
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
|||
r/w/en |
|||
r/w/c |
|||
r/w/en |
Signals¶
None
Fields¶
None
Class Details¶
- class Gtk.Scrollable¶
- Bases:
- Structure:
GtkScrollable
is an interface for widgets with native scrolling ability.To implement this interface you should override the [property`Gtk`.Scrollable:hadjustment] and [property`Gtk`.Scrollable: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 connect to the [signal`Gtk`.Adjustment::value-changed] signal. The child widget should then populate the adjustments’ properties as soon as possible, which usually means queueing an allocation right away and populating the properties in the [vfunc`Gtk`.Widget.size_allocate] implementation.
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 [vfunc`Gtk`.Widget.size_allocate] implementation.
When the parent allocates space to the scrollable child widget, the widget must ensure the adjustments’ property values are correct and up to date, for example using [method`Gtk`.Adjustment.configure].
When any of the adjustments emits the [signal`Gtk`.Adjustment::value-changed] signal, the scrollable widget should scroll its contents.
- get_border()[source]¶
- Returns:
True
if border has been set- border:
return location for the results
- Return type:
(
bool
, border:Gtk.Border
)
Returns the size of a non-scrolling border around the outside of the scrollable.
An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.
- get_hadjustment()[source]¶
- Returns:
horizontal
GtkAdjustment
.- Return type:
Retrieves the
GtkAdjustment
used for horizontal scrolling.
- get_hscroll_policy()[source]¶
- Returns:
The horizontal
GtkScrollablePolicy
.- Return type:
Gets the horizontal
GtkScrollablePolicy
.
- get_vadjustment()[source]¶
- Returns:
vertical
GtkAdjustment
.- Return type:
Retrieves the
GtkAdjustment
used for vertical scrolling.
- get_vscroll_policy()[source]¶
- Returns:
The vertical
GtkScrollablePolicy
.- Return type:
Gets the vertical
GtkScrollablePolicy
.
- set_hadjustment(hadjustment)[source]¶
- Parameters:
hadjustment (
Gtk.Adjustment
orNone
) – aGtkAdjustment
Sets the horizontal adjustment of the
GtkScrollable
.
- set_hscroll_policy(policy)[source]¶
- Parameters:
policy (
Gtk.ScrollablePolicy
) – the horizontalGtkScrollablePolicy
Sets the
GtkScrollablePolicy
.The policy determines whether horizontal scrolling should start below the minimum width or below the natural width.
- set_vadjustment(vadjustment)[source]¶
- Parameters:
vadjustment (
Gtk.Adjustment
orNone
) – aGtkAdjustment
Sets the vertical adjustment of the
GtkScrollable
.
- set_vscroll_policy(policy)[source]¶
- Parameters:
policy (
Gtk.ScrollablePolicy
) – the verticalGtkScrollablePolicy
Sets the
GtkScrollablePolicy
.The policy determines whether vertical scrolling should start below the minimum height or below the natural height.
- do_get_border() virtual¶
- Returns:
True
if border has been set- border:
return location for the results
- Return type:
(
bool
, border:Gtk.Border
)
Returns the size of a non-scrolling border around the outside of the scrollable.
An example for this would be treeview headers. GTK can use this information to display overlaid graphics, like the overshoot indication, at the right position.
Property Details¶
- Gtk.Scrollable.props.hadjustment¶
- Name:
hadjustment
- Type:
- Default Value:
- Flags:
Horizontal
GtkAdjustment
of the scrollable widget.This adjustment is shared between the scrollable widget and its parent.
- Gtk.Scrollable.props.hscroll_policy¶
- Name:
hscroll-policy
- Type:
- Default Value:
- Flags:
Determines when horizontal scrolling should start.
- Gtk.Scrollable.props.vadjustment¶
- Name:
vadjustment
- Type:
- Default Value:
- Flags:
Vertical
GtkAdjustment
of the scrollable widget.This adjustment is shared between the scrollable widget and its parent.
- Gtk.Scrollable.props.vscroll_policy¶
- Name:
vscroll-policy
- Type:
- Default Value:
- Flags:
Determines when vertical scrolling should start.