'Adjust canvas and scrollbars according to given canvas size.'

def reset(self, canvwidth=None, canvheight=None, bg=None):

    if canvwidth:
        self.canvwidth = canvwidth
    if canvheight:
        self.canvheight = canvheight
    if bg:
        self.bg = bg
    self._canvas.config(bg=bg, scrollregion=(((- self.canvwidth) // 2), ((- self.canvheight) // 2), (self.canvwidth // 2), (self.canvheight // 2)))
    self._canvas.xview_moveto(((0.5 * ((self.canvwidth - self.width) + 30)) / self.canvwidth))
    self._canvas.yview_moveto(((0.5 * ((self.canvheight - self.height) + 30)) / self.canvheight))
    self.adjustScrolls()
