code: def _ondim(self, dimension, valuestring):
          
  
          try:
              self.dimensions[dimension] = int(valuestring)
          except ValueError:
              self.dimensions[dimension] = 1
              self.textctrls[dimension].SetValue(str(1))
  
          if self.dimensions[dimension] < 1:
              self.dimensions[dimension] = 1
              self.textctrls[dimension].SetValue(str(1))
docs: Converts valuestring to int and assigns result to self.dim
  
          If there is an error (such as an empty valuestring) or if
          the value is < 1, the value 1 is assigned to self.dim
  
          Parameters
          ----------
  
          dimension: int
          \tDimension that is to be updated. Must be in [1:4]
          valuestring: string
          \t A string that can be converted to an int