parameters: (self, *args)
docstring: Adjust the label position according to the scale.
docstring_summary: Adjust the label position according to the scale.
docstring_tokens: Adjust the label position according to the scale .
function: 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 = self.scale['from'], 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)
function_tokens: 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 = self . scale [ 'from' ] , 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 )