(self, *args)
Adjust the label position according to the scale.
Adjust the label position according to the scale.
Adjust the label position according to the scale .
def _adjust(self, *args):
        """Adjust the label position according to the scale."""
        def adjust_label():
            self.update_idletasks() # "force" scale redraw

            x, y = self.scale.coords()
            if self._label_top:
                y = self.scale.winfo_y() - self.label.winfo_reqheight()
            else:
                y = self.scale.winfo_reqheight() + self.label.winfo_reqheight()

            self.label.place_configure(x=x, y=y)

        from_ = _to_number(self.scale['from'])
        to = _to_number(self.scale['to'])
        if to < from_:
            from_, to = to, from_
        newval = self._variable.get()
        if not from_ <= newval <= to:
            # value outside range, set value back to the last valid one
            self.value = self._last_valid
            return

        self._last_valid = newval
        self.label['text'] = newval
        self.after_idle(adjust_label)
def _adjust ( self , * args ) : def adjust_label ( ) : self . update_idletasks ( ) # "force" scale redraw x , y = self . scale . coords ( ) if self . _label_top : y = self . scale . winfo_y ( ) - self . label . winfo_reqheight ( ) else : y = self . scale . winfo_reqheight ( ) + self . label . winfo_reqheight ( ) self . label . place_configure ( x = x , y = y ) from_ = _to_number ( self . scale [ 'from' ] ) to = _to_number ( self . scale [ 'to' ] ) if to < from_ : from_ , to = to , from_ newval = self . _variable . get ( ) if not from_ <= newval <= to : # value outside range, set value back to the last valid one self . value = self . _last_valid return self . _last_valid = newval self . label [ 'text' ] = newval self . after_idle ( adjust_label )