(self, scroll_view, direction)
Create a scrollbar for the given scrollable view.
Create a scrollbar for the given scrollable view.
Create a scrollbar for the given scrollable view .
def __init__(self, scroll_view, direction):
        """Create a scrollbar for the given scrollable view."""
        if direction == VERTICAL:
            height = scroll_view.frame.h - SCROLLBAR_SIZE
            frame = pygame.Rect(0, 0, SCROLLBAR_SIZE, height)
            frame.right = scroll_view.frame.w
        else:
            width = scroll_view.frame.w - SCROLLBAR_SIZE
            frame = pygame.Rect(0, 0, width, SCROLLBAR_SIZE)
            frame.bottom = scroll_view.frame.h
        view.View.__init__(self, frame)

        self.direction = direction
        self.scroll_view = scroll_view

        self.thumb = ScrollbarThumbView(self.direction)
        self.add_child(self.thumb)
def __init__ ( self , scroll_view , direction ) : if direction == VERTICAL : height = scroll_view . frame . h - SCROLLBAR_SIZE frame = pygame . Rect ( 0 , 0 , SCROLLBAR_SIZE , height ) frame . right = scroll_view . frame . w else : width = scroll_view . frame . w - SCROLLBAR_SIZE frame = pygame . Rect ( 0 , 0 , width , SCROLLBAR_SIZE ) frame . bottom = scroll_view . frame . h view . View . __init__ ( self , frame ) self . direction = direction self . scroll_view = scroll_view self . thumb = ScrollbarThumbView ( self . direction ) self . add_child ( self . thumb )