(self)
Adjust scrollbars according to window- and canvas-size.
Adjust scrollbars according to window- and canvas-size.
Adjust scrollbars according to window - and canvas - size .
def adjustScrolls(self):
        """ Adjust scrollbars according to window- and canvas-size.
        """
        cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)
        if cwidth < self.canvwidth or cheight < self.canvheight:
            self.hscroll.grid(padx=1, in_ = self, pady=1, row=1,
                              column=0, rowspan=1, columnspan=1, sticky='news')
            self.vscroll.grid(padx=1, in_ = self, pady=1, row=0,
                              column=1, rowspan=1, columnspan=1, sticky='news')
        else:
            self.hscroll.grid_forget()
            self.vscroll.grid_forget()
def adjustScrolls ( self ) : cwidth = self . _canvas . winfo_width ( ) cheight = self . _canvas . winfo_height ( ) self . _canvas . xview_moveto ( 0.5 * ( self . canvwidth - cwidth ) / self . canvwidth ) self . _canvas . yview_moveto ( 0.5 * ( self . canvheight - cheight ) / self . canvheight ) if cwidth < self . canvwidth or cheight < self . canvheight : self . hscroll . grid ( padx = 1 , in_ = self , pady = 1 , row = 1 , column = 0 , rowspan = 1 , columnspan = 1 , sticky = 'news' ) self . vscroll . grid ( padx = 1 , in_ = self , pady = 1 , row = 0 , column = 1 , rowspan = 1 , columnspan = 1 , sticky = 'news' ) else : self . hscroll . grid_forget ( ) self . vscroll . grid_forget ( )