MCPcopy Create free account
hub / github.com/Image-Py/imagepy / GetValue

Method GetValue

imagepy/ui/widgets/normal.py:43–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41 self.ctrl.SetValue(str(round(n,self.accury) if self.accury>0 else int(n)))
42
43 def GetValue(self):
44 sval = self.ctrl.GetValue()
45 try:
46 num = float(sval) if self.accury>0 else int(sval)
47 except ValueError:
48 return None
49 if num<self.min or num>self.max:
50 return None
51 if abs(round(num, self.accury) - num) > 1E-5:
52 return None
53 return num
54
55class TextCtrl(wx.Panel):
56 """NumCtrl: diverid from wx.core.TextCtrl """

Callers 1

ontextMethod · 0.95

Calls 1

GetValueMethod · 0.45

Tested by

no test coverage detected