From 2d5116c935cf21e3c41844115431e7c2bde32855 Mon Sep 17 00:00:00 2001 From: gac-maloja Date: Sat, 7 Oct 2023 20:29:33 +0200 Subject: [PATCH] added clear method; return None for empty boxes --- listentry.py | 5 +++++ mathentry.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/listentry.py b/listentry.py index 38b0f8e..783c005 100644 --- a/listentry.py +++ b/listentry.py @@ -37,4 +37,9 @@ class ListEntry(wx.BoxSizer): return [e.Enable() for e in self.entries] + def clear(self): + for e in self.entries: + e.clear() + + diff --git a/mathentry.py b/mathentry.py index f23c7d5..ad49f23 100644 --- a/mathentry.py +++ b/mathentry.py @@ -25,6 +25,9 @@ class MathEntry(wx.TextCtrl): def GetValue(self): val = super().GetValue() + if val == "": #TODO? + return None + if val == "None": #TODO? return None @@ -90,4 +93,8 @@ class MathEntry(wx.TextCtrl): self.SetForegroundColour(wx.NullColour) + def clear(self): + super().SetValue("") + +