Handy.Paginator

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable Handy.Swipeable Handy.Swipeable GObject.GInterface->Handy.Swipeable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.EventBox Gtk.EventBox Gtk.Bin->Gtk.EventBox Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Handy.Paginator Handy.Paginator Gtk.EventBox->Handy.Paginator Gtk.Orientable->Handy.Paginator Gtk.Widget->Gtk.Container Handy.Swipeable->Handy.Paginator

Subclasses:None

Properties

Inherited:Gtk.EventBox (2), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name Type Flags Short Description
allow-mouse-drag bool r/w/en Whether to allow dragging with mouse pointer
animation-duration int r/w/en Default animation duration
center-content bool r/w/en Whether to center pages to compensate for indicators
indicator-spacing int r/w/en Spacing between content and indicators
indicator-style Handy.PaginatorIndicatorStyle r/w/en Page indicator style
interactive bool r/w/en Whether the widget can be swiped
n-pages int r/en Number of pages
position float r/en Current scrolling position
spacing int r/w/en Spacing between pages

Style Properties

Inherited:Gtk.Widget (17)

Signals

Inherited:Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Handy.Swipeable (4)
Name Short Description
page-changed This signal is emitted after a page has been changed.

Class Details

class Handy.Paginator(**kwargs)
Bases:Gtk.EventBox, Gtk.Orientable, Handy.Swipeable
Abstract:No
Structure:Handy.PaginatorClass
classmethod new()
Returns:The newly created Handy.Paginator widget
Return type:Handy.Paginator

Create a new Handy.Paginator widget.

New in version 0.0.11.

get_allow_mouse_drag()
Returns:True if self can be dragged with mouse
Return type:bool

Sets whether self can be dragged with mouse pointer

New in version 0.0.12.

get_animation_duration()
Returns:Animation duration in milliseconds
Return type:int

Gets animation duration used by Handy.Paginator.scroll_to().

New in version 0.0.11.

get_center_content()
Returns:True if self is centering pages
Return type:bool

Sets whether self is centering pages.

New in version 0.0.11.

get_indicator_spacing()
Returns:Spacing between content and indicators
Return type:int

Gets spacing between content and page indicators.

New in version 0.0.11.

get_indicator_style()
Returns:the current indicator style
Return type:Handy.PaginatorIndicatorStyle

Gets the current page indicator style.

New in version 0.0.11.

get_interactive()
Returns:True if self can be swiped
Return type:bool

Gets whether self can be navigated.

New in version 0.0.11.

get_n_pages()
Returns:The number of pages in self
Return type:int

Gets the number of pages in self.

New in version 0.0.11.

get_position()
Returns:The scroll position
Return type:float

Gets current scroll position in self. It’s unitless, 1 matches 1 page.

New in version 0.0.11.

get_spacing()
Returns:Spacing between pages
Return type:int

Gets spacing between pages in pixels.

New in version 0.0.11.

insert(child, position)
Parameters:
  • child (Gtk.Widget) – a widget to add
  • position (int) – the position to insert child in.

Inserts child into self at position position.

If position is -1, or larger than the number of pages, child will be appended to the end.

New in version 0.0.11.

prepend(child)
Parameters:child (Gtk.Widget) – a widget to add

Prepends child to self

New in version 0.0.11.

reorder(child, position)
Parameters:
  • child (Gtk.Widget) – a widget to add
  • position (int) – the position to move child to.

Moves child into position position.

If position is -1, or larger than the number of pages, child will be moved to the end.

New in version 0.0.11.

scroll_to(widget)
Parameters:widget (Gtk.Widget) – a child of self

Scrolls to widget position with an animation. Handy.Paginator :animation-duration property can be used for controlling the duration.

New in version 0.0.11.

scroll_to_full(widget, duration)
Parameters:
  • widget (Gtk.Widget) – a child of self
  • duration (int) – animation duration in milliseconds

Scrolls to widget position with an animation.

New in version 0.0.11.

set_allow_mouse_drag(allow_mouse_drag)
Parameters:allow_mouse_drag (bool) – whether self can be dragged with mouse pointer

Sets whether self can be dragged with mouse pointer. If allow_mouse_drag is False, dragging is only available on touch.

This should usually be False.

New in version 0.0.12.

set_animation_duration(duration)
Parameters:duration (int) – animation duration in milliseconds

Sets animation duration used by Handy.Paginator.scroll_to().

New in version 0.0.11.

set_center_content(center_content)
Parameters:center_content (bool) – whether self should center contents

Sets whether self is centering content. If Handy.Paginator :indicator-style is Handy.PaginatorIndicatorStyle.NONE, centering does nothing, otherwise it adds whitespace to the left or above the pages to compensate for the indicators.

New in version 0.0.11.

set_indicator_spacing(spacing)
Parameters:spacing (int) – the new spacing value

Sets spacing between content and page indicators. Does nothing if Handy.Paginator :indicator-style is Handy.PaginatorIndicatorStyle.NONE.

New in version 0.0.11.

set_indicator_style(style)
Parameters:style (Handy.PaginatorIndicatorStyle) – indicator style to use

Sets style of page indicators. Depending on orientation, they are displayed below or besides the pages. If the pages are meant to be centered, Handy.Paginator :center-content can be used to compensate for that.

New in version 0.0.11.

set_interactive(interactive)
Parameters:interactive (bool) – whether self can be swiped.

Sets whether self can be navigated. This can be used to temporarily disable a Handy.Paginator to only allow swiping in a certain state.

New in version 0.0.11.

set_spacing(spacing)
Parameters:spacing (int) – the new spacing value

Sets spacing between pages in pixels.

New in version 0.0.11.

Signal Details

Handy.Paginator.signals.page_changed(paginator, index)
Signal Name:

page-changed

Flags:

RUN_LAST

Parameters:
  • paginator (Handy.Paginator) – The object which received the signal
  • index (int) – Current page

This signal is emitted after a page has been changed. This can be used to implement “infinite scrolling” by connecting to this signal and amending the pages.

New in version 0.0.12.

Property Details

Handy.Paginator.props.allow_mouse_drag
Name:allow-mouse-drag
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Sets whether the Handy.Paginator can be dragged with mouse pointer. If the value is False, dragging is only available on touch.

This should usually be False.

New in version 0.0.12.

Handy.Paginator.props.animation_duration
Name:animation-duration
Type:int
Default Value:250
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Animation duration in milliseconds, used by Handy.Paginator.scroll_to().

New in version 0.0.11.

Handy.Paginator.props.center_content
Name:center-content
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the Handy.Paginator is centering pages. If Handy.Paginator :indicator-style is Handy.PaginatorIndicatorStyle.NONE, centering does nothing, otherwise it adds whitespace to the left or above the pages to compensate for the indicators.

New in version 0.0.11.

Handy.Paginator.props.indicator_spacing
Name:indicator-spacing
Type:int
Default Value:0
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Spacing between content and page indicators. Does nothing if Handy.Paginator :indicator-style is Handy.PaginatorIndicatorStyle.NONE.

New in version 0.0.11.

Handy.Paginator.props.indicator_style
Name:indicator-style
Type:Handy.PaginatorIndicatorStyle
Default Value:Handy.PaginatorIndicatorStyle.NONE
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

The style of page indicators. Depending on orientation, they are displayed below or besides the pages. If the pages are meant to be centered, Handy.Paginator :center-content can be used to compensate for that.

New in version 0.0.11.

Handy.Paginator.props.interactive
Name:interactive
Type:bool
Default Value:True
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether self can be navigated. This can be used to temporarily disable a Handy.Paginator to only allow navigating it in a certain state.

New in version 0.0.11.

Handy.Paginator.props.n_pages
Name:n-pages
Type:int
Default Value:0
Flags:READABLE, EXPLICIT_NOTIFY

The number of pages in a Handy.Paginator

New in version 0.0.11.

Handy.Paginator.props.position
Name:position
Type:float
Default Value:0.0
Flags:READABLE, EXPLICIT_NOTIFY

Current scrolling position, unitless. 1 matches 1 page. Use Handy.Paginator.scroll_to() for changing it.

New in version 0.0.11.

Handy.Paginator.props.spacing
Name:spacing
Type:int
Default Value:0
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Spacing between pages in pixels.

New in version 0.0.11.