Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05d38ff

Browse files
committed
Merge pull request #2004 from efiring/EF_wx_cocoa
Make wx and wxagg work with wx 2.9.x on Mac.
2 parents d6c6afd + 65027cf commit 05d38ff

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,21 +1506,14 @@ def __init__(self, num, fig):
15061506

15071507
if self.toolbar is not None:
15081508
self.toolbar.Realize()
1509-
if wx.Platform == '__WXMAC__':
1510-
# Mac platform (OSX 10.3, MacPython) does not seem to cope with
1511-
# having a toolbar in a sizer. This work-around gets the buttons
1512-
# back, but at the expense of having the toolbar at the top
1513-
self.SetToolBar(self.toolbar)
1514-
else:
1515-
# On Windows platform, default window size is incorrect, so set
1516-
# toolbar width to figure width.
1517-
tw, th = self.toolbar.GetSizeTuple()
1518-
fw, fh = self.canvas.GetSizeTuple()
1519-
# By adding toolbar in sizer, we are able to put it at the bottom
1520-
# of the frame - so appearance is closer to GTK version.
1521-
# As noted above, doesn't work for Mac.
1522-
self.toolbar.SetSize(wx.Size(fw, th))
1523-
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
1509+
# On Windows platform, default window size is incorrect, so set
1510+
# toolbar width to figure width.
1511+
tw, th = self.toolbar.GetSizeTuple()
1512+
fw, fh = self.canvas.GetSizeTuple()
1513+
# By adding toolbar in sizer, we are able to put it at the bottom
1514+
# of the frame - so appearance is closer to GTK version.
1515+
self.toolbar.SetSize(wx.Size(fw, th))
1516+
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
15241517
self.SetSizer(self.sizer)
15251518
self.Fit()
15261519

0 commit comments

Comments
 (0)