--- a/BeremizIDE.py Tue Mar 29 08:19:46 2022 +0200
+++ b/BeremizIDE.py Tue Mar 29 08:30:03 2022 +0200
@@ -360,6 +360,8 @@
self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, id=inspectorID)
accels = [wx.AcceleratorEntry(wx.ACCEL_CTRL | wx.ACCEL_ALT, ord('I'), inspectorID)]
+ self.methodLock = Lock() for method, shortcut in [("Stop", wx.WXK_F4),
@@ -369,8 +371,15 @@
def OnMethodGen(obj, meth):
- obj.CTR.CallMethod('_'+meth)
- wx.CallAfter(self.RefreshStatusToolBar)
+ if obj.methodLock.acquire(False): + obj.CTR.CallMethod('_'+meth) + obj.methodLock.release() + wx.CallAfter(obj.RefreshStatusToolBar) + # Postpone call if one of method already running + # can happen because of long method using log, + # itself calling wx.Yield + wx.CallLater(50, OnMethod, evt) self.Bind(wx.EVT_MENU, OnMethodGen(self, method), id=newid)