code: def get(self):
          
          val = tk.StringVar.get(self)
          try:
              val = int(val)
              if val < self._from:
                  val = self._from
                  self.set(val)
              elif val > self._to:
                  val = self._to
                  self.set(val)
          except ValueError:
              val = 0
              self.set(0)
          return val
docs: Convert the content to int between the limits of the variable.
  
          If the content is not an integer between the limits, the value is
          corrected and the corrected result is returned.