def zoom_out ( self ) : index = self . _zoom_factors . index ( self . _zoom_factor ) if index == 0 : # Already zoomed out all the way return self . _zoom_factor = self . _zoom_factors [ index - 1 ] if self . _zoom_factors . index ( self . _zoom_factor ) == 0 : self . _button_zoom_out . config ( state = tk . DISABLED ) self . _button_zoom_in . config ( state = tk . NORMAL ) self . draw_timeline ( )
how to create a zoom out button in tkinter python
Decrease zoom factor and redraw TimeLine
def zoom_out(self):
        """Decrease zoom factor and redraw TimeLine"""
        index = self._zoom_factors.index(self._zoom_factor)
        if index == 0:
            # Already zoomed out all the way
            return
        self._zoom_factor = self._zoom_factors[index - 1]
        if self._zoom_factors.index(self._zoom_factor) == 0:
            self._button_zoom_out.config(state=tk.DISABLED)
        self._button_zoom_in.config(state=tk.NORMAL)
        self.draw_timeline()