peng3d/gui/container.py
def on_redraw(self):
        """
        Redraws the background and contents, including scrollbar.
        
        This method will also check the scrollbar for any movement and will be automatically called on movement of the slider.
        """
        n = self._scrollbar.n
        self.offset_y = -n # Causes the content to move in the opposite direction of the slider
        
        # Size of scrollbar
        sx=24 # Currently constant, TODO: add dynamic sx of scrollbar
        sy=self.size[1]
        # Pos of scrollbar
        x=self.size[0]-sx
        y=0 # Currently constant, TODO: add dynamic y-pos of scrollbar
        
        # Dynamic pos/size may be added via align/lambda/etc.
        
        # Note that the values are written to the _* variant of the attribute to avoid 3 uneccessary redraws
        self._scrollbar._size = sx,sy
        self._scrollbar._pos = x,y
        self._scrollbar._nmax = self.content_height
        
        super(ScrollableContainer,self).on_redraw()
def on_redraw(self):
        n = self._scrollbar.n
        self.offset_y = -n # Causes the content to move in the opposite direction of the slider
        
        # Size of scrollbar
        sx=24 # Currently constant, TODO: add dynamic sx of scrollbar
        sy=self.size[1]
        # Pos of scrollbar
        x=self.size[0]-sx
        y=0 # Currently constant, TODO: add dynamic y-pos of scrollbar
        
        # Dynamic pos/size may be added via align/lambda/etc.
        
        # Note that the values are written to the _* variant of the attribute to avoid 3 uneccessary redraws
        self._scrollbar._size = sx,sy
        self._scrollbar._pos = x,y
        self._scrollbar._nmax = self.content_height
        
        super(ScrollableContainer,self).on_redraw()
def on_redraw ( self ) : n = self . _scrollbar . n self . offset_y = - n # Causes the content to move in the opposite direction of the slider # Size of scrollbar sx = 24 # Currently constant, TODO: add dynamic sx of scrollbar sy = self . size [ 1 ] # Pos of scrollbar x = self . size [ 0 ] - sx y = 0 # Currently constant, TODO: add dynamic y-pos of scrollbar # Dynamic pos/size may be added via align/lambda/etc. # Note that the values are written to the _* variant of the attribute to avoid 3 uneccessary redraws self . _scrollbar . _size = sx , sy self . _scrollbar . _pos = x , y self . _scrollbar . _nmax = self . content_height super ( ScrollableContainer , self ) . on_redraw ( )
Redraws the background and contents, including scrollbar.
        
        This method will also check the scrollbar for any movement and will be automatically called on movement of the slider.
Redraws the background and contents including scrollbar . This method will also check the scrollbar for any movement and will be automatically called on movement of the slider .