@@ -1271,8 +1271,12 @@ def __init__(self, num, fig):
1271
1271
self .toolbar .Realize ()
1272
1272
# On Windows platform, default window size is incorrect, so set
1273
1273
# toolbar width to figure width.
1274
- tw , th = self .toolbar .GetSizeTuple ()
1275
- fw , fh = self .canvas .GetSizeTuple ()
1274
+ if wxc .is_phoenix :
1275
+ tw , th = self .toolbar .GetSize ()
1276
+ fw , fh = self .canvas .GetSize ()
1277
+ else :
1278
+ tw , th = self .toolbar .GetSizeTuple ()
1279
+ fw , fh = self .canvas .GetSizeTuple ()
1276
1280
# By adding toolbar in sizer, we are able to put it at the bottom
1277
1281
# of the frame - so appearance is closer to GTK version.
1278
1282
self .toolbar .SetSize (wx .Size (fw , th ))
@@ -1370,9 +1374,9 @@ def show(self):
1370
1374
def destroy (self , * args ):
1371
1375
DEBUG_MSG ("destroy()" , 1 , self )
1372
1376
self .frame .Destroy ()
1373
- #if self.tb is not None: self.tb.Destroy ()
1374
- # wx.GetApp().ProcessIdle()
1375
- wx . WakeUpIdle ()
1377
+ wxapp = wx . GetApp ()
1378
+ if wxapp :
1379
+ wxapp . Yield ()
1376
1380
1377
1381
def get_window_title (self ):
1378
1382
return self .window .GetTitle ()
@@ -1457,8 +1461,12 @@ def Destroy(self):
1457
1461
1458
1462
def _onMenuButton (self , evt ):
1459
1463
"""Handle menu button pressed."""
1460
- x , y = self .GetPositionTuple ()
1461
- w , h = self .GetSizeTuple ()
1464
+ if wxc .is_phoenix :
1465
+ x , y = self .GetPosition ()
1466
+ w , h = self .GetSize ()
1467
+ else :
1468
+ x , y = self .GetPositionTuple ()
1469
+ w , h = self .GetSizeTuple ()
1462
1470
self .PopupMenuXY (self ._menu , x , y + h - 4 )
1463
1471
# When menu returned, indicate selection in button
1464
1472
evt .Skip ()
@@ -1779,7 +1787,10 @@ def OnPrintPage(self, page):
1779
1787
(ppw , pph ) = self .GetPPIPrinter () # printer's pixels per in
1780
1788
(pgw , pgh ) = self .GetPageSizePixels () # page size in pixels
1781
1789
(dcw , dch ) = dc .GetSize ()
1782
- (grw , grh ) = self .canvas .GetSizeTuple ()
1790
+ if wxc .is_phoenix :
1791
+ (grw , grh ) = self .canvas .GetSize ()
1792
+ else :
1793
+ (grw , grh ) = self .canvas .GetSizeTuple ()
1783
1794
1784
1795
# save current figure dpi resolution and bg color,
1785
1796
# so that we can temporarily set them to the dpi of
0 commit comments