File: scroll_handler.py

package info (click to toggle)
python-enable 3.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,392 kB
  • ctags: 17,135
  • sloc: cpp: 79,151; python: 29,601; makefile: 2,926; sh: 43
file content (39 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Interface for scroll handlers.
"""

class ScrollHandler:
    """ The interface for scroll handlers.

    A scroll handler handles the scroll events generated by scrollbar events
    in a Scrolled component.  By default, a Scrolled will serve as its own
    ScrollHandler.  In that role, Scrolled will merely move and clip the
    child component.  
    
    If a component wishes to manage its own scrolling, it may do so, by
    implementing this interface and attaching itself as its parent's scroll
    manager.

    """

    def handle_vertical_scroll(self, position):
        """ Called when the vertical scroll position has changed.

        The position parameter will be the current position of the vertical
        scroll bar.

        """

        raise NotImplementedError

    def handle_horizontal_scroll(self, position):
        """ Called when the horizontal scroll position has changed.

        The position parameter will be the current position of the horizontal
        scroll bar.

        """

        raise NotImplementedError

#### EOF ######################################################################