A ScrollableView is a View with support for scrolling.
Properties
- scrolling
- A string containing 'h' to enable horizontal scrolling and 'v' to enable vertical scrolling.
- hscrolling
- True if horizontal scrolling is enabled.
- vscrolling
- True if vertical scrolling is enabled.
- extent
- Tuple (width, height) defining the size of the scrollable area.
- scroll_offset
- Tuple (dx, dy) representing the difference in local coordinates between
the top left corner of the view's bounds and the top left corner of the
extent. Assigning to this property will cause the view to scroll. The value
is clamped to the allowable scrolling range, as determined by the current
bounds and extent.
- line_scroll_amount
- Tuple (dh, dv) representing the size of a "line" in each direction
for scrolling purposes.
- background_color
- Color with which to fill any visible area of the view that lies outside the extent, or None to suppress automatic background drawing. When a background color is specified, the update_rect passed to the draw() method is clipped to exclude areas outside the extent.
Note: On MacOSX, it is impossible to draw outside the view's extent even when the background color is set to None.
Methods
- scroll_by(dx, dy)
- Scrolls the view by the given horizontal and vertical amounts, within
the limits defined by the extent.
- scroll_line_left()
- scroll_line_right()
- scroll_line_up()
- scroll_line_down()
- Scrolls the view by one line in the specified direction, as determined
by the line_scroll_amount property.
- scroll_page_left()
- scroll_page_right()
- scroll_page_up()
- scroll_page_down()
- Scrolls the view by one page in the specified direction. The size
of a page is equal to the size of the viewed rectangle minus the line_scroll_amount.
---