def _increment ( self , * args ) : value = self . _var . get ( ) if self . _resolution : value = self . _start + int ( round ( ( value - self . _start ) / self . _resolution ) ) * self . _resolution self . _var . set ( value ) self . display_value ( value )
fixed value in slider widget python
Move the slider only by increment given by resolution .
def _increment(self, *args):
        """Move the slider only by increment given by resolution."""
        value = self._var.get()
        if self._resolution:
            value = self._start + int(round((value - self._start) / self._resolution)) * self._resolution
            self._var.set(value)
        self.display_value(value)