Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make wx and wxagg work with wx 2.9.x on Mac. #2004

Merged
merged 1 commit into from

2 participants

@efiring
Owner

This affects the wx* backends on OSX only. It removes Mac-specific
code that was letting the Frame manage the toolbar directly, without
using the Sizer. There was a comment saying that this was needed
for OSX 10.3. With wx 2.9.x, however, this method of handling
the toolbar does not work at all; no toolbar appears, and the
program can hang or otherwise behave erratically. The Sizer
method, however, works.

The big question is whether the Sizer method works on the Mac
with wx 2.8.x. If it does, then this can be merged.

@mdboom
Owner

As a data point, this works fine with wx 2.8.12 on my Linux box.

Any testers with wx 2.8 on their Mac? It seems harmless enough...

@mdboom
Owner

@efiring: I'm fine with merging this now and then hopefully using the release candidate as an excuse for more users to test this and find issue if any. So feel free to merge if you agree.

@efiring efiring Make wx and wxagg work with wx 2.9.x on Mac.
This affects the wx* backends on OSX only.  It removes Mac-specific
code that was letting the Frame manage the toolbar directly, without
using the Sizer.  There was a comment saying that this was needed
for OSX 10.3.  With wx 2.9.x, however, this method of handling
the toolbar does not work at all; no toolbar appears, and the
program can hang or otherwise behave erratically.  The Sizer
method, however, works.

The big question is whether the Sizer method works on the Mac
with wx 2.8.x.  If it does, then this can be merged.
65027cf
@efiring
Owner

@mdboom, I added a commit to delete a comment line, squashed, and force-pushed; but github does seem to be hung (checking for ability to merge), so I won't try to merge yet.

@mdboom
Owner

I saw something like that elsewhere a few minutes ago, but it did seem to eventually update after about 15 minutes. They must be live coding on the site again ;)

@efiring efiring merged commit 05d38ff into from
@efiring efiring deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 24, 2013
  1. @efiring

    Make wx and wxagg work with wx 2.9.x on Mac.

    efiring authored
    This affects the wx* backends on OSX only.  It removes Mac-specific
    code that was letting the Frame manage the toolbar directly, without
    using the Sizer.  There was a comment saying that this was needed
    for OSX 10.3.  With wx 2.9.x, however, this method of handling
    the toolbar does not work at all; no toolbar appears, and the
    program can hang or otherwise behave erratically.  The Sizer
    method, however, works.
    
    The big question is whether the Sizer method works on the Mac
    with wx 2.8.x.  If it does, then this can be merged.
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 15 deletions.
  1. +8 −15 lib/matplotlib/backends/backend_wx.py
View
23 lib/matplotlib/backends/backend_wx.py
@@ -1506,21 +1506,14 @@ def __init__(self, num, fig):
if self.toolbar is not None:
self.toolbar.Realize()
- if wx.Platform == '__WXMAC__':
- # Mac platform (OSX 10.3, MacPython) does not seem to cope with
- # having a toolbar in a sizer. This work-around gets the buttons
- # back, but at the expense of having the toolbar at the top
- self.SetToolBar(self.toolbar)
- else:
- # On Windows platform, default window size is incorrect, so set
- # toolbar width to figure width.
- tw, th = self.toolbar.GetSizeTuple()
- fw, fh = self.canvas.GetSizeTuple()
- # By adding toolbar in sizer, we are able to put it at the bottom
- # of the frame - so appearance is closer to GTK version.
- # As noted above, doesn't work for Mac.
- self.toolbar.SetSize(wx.Size(fw, th))
- self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
+ # On Windows platform, default window size is incorrect, so set
+ # toolbar width to figure width.
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ # By adding toolbar in sizer, we are able to put it at the bottom
+ # of the frame - so appearance is closer to GTK version.
+ self.toolbar.SetSize(wx.Size(fw, th))
+ self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
self.SetSizer(self.sizer)
self.Fit()
Something went wrong with that request. Please try again.