@@ -713,11 +713,10 @@ def start_event_loop(self, timeout=0):
713
713
"""
714
714
if hasattr (self , '_event_loop' ):
715
715
raise RuntimeError ("Event loop already running" )
716
- id = wx .NewId ()
717
- timer = wx .Timer (self , id = id )
716
+ timer = wx .Timer (self , id = wx .ID_ANY )
718
717
if timeout > 0 :
719
718
timer .Start (timeout * 1000 , oneShot = True )
720
- self .Bind (wx .EVT_TIMER , self .stop_event_loop , id = id )
719
+ self .Bind (wx .EVT_TIMER , self .stop_event_loop , id = timer . GetId () )
721
720
722
721
# Event loop handler for start/stop event loop
723
722
self ._event_loop = wx .GUIEventLoop ()
@@ -1293,26 +1292,6 @@ def resize(self, width, height):
1293
1292
self .canvas .SetInitialSize (wx .Size (width , height ))
1294
1293
self .window .GetSizer ().Fit (self .window )
1295
1294
1296
- # Identifiers for toolbar controls - images_wx contains bitmaps for the images
1297
- # used in the controls. wxWindows does not provide any stock images, so I've
1298
- # 'stolen' those from GTK2, and transformed them into the appropriate format.
1299
- # import images_wx
1300
-
1301
-
1302
- _NTB_AXISMENU = wx .NewId ()
1303
- _NTB_AXISMENU_BUTTON = wx .NewId ()
1304
- _NTB_X_PAN_LEFT = wx .NewId ()
1305
- _NTB_X_PAN_RIGHT = wx .NewId ()
1306
- _NTB_X_ZOOMIN = wx .NewId ()
1307
- _NTB_X_ZOOMOUT = wx .NewId ()
1308
- _NTB_Y_PAN_UP = wx .NewId ()
1309
- _NTB_Y_PAN_DOWN = wx .NewId ()
1310
- _NTB_Y_ZOOMIN = wx .NewId ()
1311
- _NTB_Y_ZOOMOUT = wx .NewId ()
1312
- # _NTB_SUBPLOT =wx.NewId()
1313
- _NTB_SAVE = wx .NewId ()
1314
- _NTB_CLOSE = wx .NewId ()
1315
-
1316
1295
1317
1296
def _load_bitmap (filename ):
1318
1297
"""
@@ -1356,7 +1335,7 @@ class MenuButtonWx(wx.Button):
1356
1335
1357
1336
def __init__ (self , parent ):
1358
1337
1359
- wx .Button .__init__ (self , parent , _NTB_AXISMENU_BUTTON , "Axes: " ,
1338
+ wx .Button .__init__ (self , parent , wx . ID_ANY , "Axes: " ,
1360
1339
style = wx .BU_EXACTFIT )
1361
1340
self ._toolbar = parent
1362
1341
self ._menu = wx .Menu ()
@@ -1369,7 +1348,7 @@ def __init__(self, parent):
1369
1348
False )
1370
1349
self ._menu .AppendSeparator ()
1371
1350
1372
- self .Bind (wx .EVT_BUTTON , self ._onMenuButton , id = _NTB_AXISMENU_BUTTON )
1351
+ self .Bind (wx .EVT_BUTTON , self ._onMenuButton , id = self . GetId () )
1373
1352
self .Bind (wx .EVT_MENU , self ._handleSelectAllAxes , id = self ._allId )
1374
1353
self .Bind (wx .EVT_MENU , self ._handleInvertAxesSelected ,
1375
1354
id = self ._invertId )
0 commit comments