More wx.NewID abuse removal. This one was apparently silently unbinding toolbar butons when running out of mew wx IDs. wx.NewID_abuse_fix
authorEdouard Tisserant
Wed, 27 Mar 2019 13:08:51 +0100
branchwx.NewID_abuse_fix
changeset 2566 66a3c64c8dd0
parent 2557 a6e7c34497b8
child 2567 eb9392511989
More wx.NewID abuse removal. This one was apparently silently unbinding toolbar butons when running out of mew wx IDs.
BeremizIDE.py
--- a/BeremizIDE.py	Tue Mar 26 11:03:57 2019 +0100
+++ b/BeremizIDE.py	Wed Mar 27 13:08:51 2019 +0100
@@ -743,11 +743,10 @@
 
             for confnode_method in self.CTR.StatusMethods:
                 if "method" in confnode_method and confnode_method.get("shown", True):
-                    id = wx.NewId()
-                    StatusToolBar.AddSimpleTool(
-                        id, GetBitmap(confnode_method.get("bitmap", "Unknown")),
+                    tool = StatusToolBar.AddSimpleTool(
+                        wx.ID_ANY, GetBitmap(confnode_method.get("bitmap", "Unknown")),
                         confnode_method["tooltip"])
-                    self.Bind(wx.EVT_MENU, self.GetMenuCallBackFunction(confnode_method["method"]), id=id)
+                    self.Bind(wx.EVT_MENU, self.GetMenuCallBackFunction(confnode_method["method"]), tool)
 
             StatusToolBar.Realize()
             self.AUIManager.GetPane("StatusToolBar").BestSize(StatusToolBar.GetBestSize()).Show()