Skip to content

Scrollbar

Implements the scrollbar-related widgets for internal use.

You will not need to use the widgets defined in this module.

ScrollBar class

def __init__(self, vertical=True, name=None, *, thickness=1):

Bases: Widget

renderer class-attribute

renderer: Type[ScrollBarRender] = ScrollBarRender

The class used for rendering scrollbars. This can be overridden and set to a ScrollBarRender-derived class in order to delegate all scrollbar rendering to that class. E.g.:

class MyScrollBarRender(ScrollBarRender): ...

app = MyApp()
ScrollBar.renderer = MyScrollBarRender
app.run()

Because this variable is accessed through specific instances (rather than through the class ScrollBar itself) it is also possible to set this on specific scrollbar instance to change only that instance:

my_widget.horizontal_scrollbar.renderer = MyScrollBarRender

action_grab method

def action_grab(self):

Begin capturing the mouse cursor.

action_scroll_down method

def action_scroll_down(self):

Scroll vertical scrollbars down, horizontal scrollbars right.

action_scroll_up method

def action_scroll_up(self):

Scroll vertical scrollbars up, horizontal scrollbars left.

ScrollBarCorner class

def __init__(self, name=None):

Bases: Widget

Widget which fills the gap between horizontal and vertical scrollbars, should they both be present.

ScrollDown class

Bases: ScrollMessage

Message sent when clicking below handle.

ScrollLeft class

Bases: ScrollMessage

Message sent when clicking above handle.

ScrollMessage class

Bases: Message

Base class for all scrollbar messages.

ScrollRight class

Bases: ScrollMessage

Message sent when clicking below handle.

ScrollTo class

def __init__(self, x=None, y=None, animate=True):

Bases: ScrollMessage

Message sent when click and dragging handle.

ScrollUp class

Bases: ScrollMessage

Message sent when clicking above handle.