Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Unify toolbar init across backends.#22250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -901,13 +901,9 @@ def __init__(self, num, fig, *, canvas_class=None): | ||||||
| self.figmgr = FigureManagerWx(self.canvas, num, self) | ||||||
| toolbar = self.canvas.manager.toolbar | ||||||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is that not? Suggested change
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yes, but I have some later plans to get rid of the (non-standard) figmgr as well... | ||||||
| if toolbar is not None: | ||||||
| self.SetToolBar(toolbar) | ||||||
| # On Windows, canvas sizing must occur after toolbar addition; | ||||||
| # otherwise the toolbar further resizes the canvas. | ||||||
| @@ -920,18 +916,8 @@ def __init__(self, num, fig, *, canvas_class=None): | ||||||
| self.Bind(wx.EVT_CLOSE, self._on_close) | ||||||
| toolmanager = property(lambda self: self.figmgr.toolmanager) | ||||||
| toolbar = property(lambda self: self.GetToolBar()) # backcompat | ||||||
| @_api.deprecated( | ||||||
| "3.6", alternative="the canvas_class constructor parameter") | ||||||
| @@ -956,7 +942,7 @@ def _on_close(self, event): | ||||||
| def Destroy(self, *args, **kwargs): | ||||||
| try: | ||||||
| self.canvas.mpl_disconnect(self.canvas.manager.toolbar._id_drag) | ||||||
| # Rationale for line above: see issue 2941338. | ||||||
| except AttributeError: | ||||||
| pass # classic toolbar lacks the attribute | ||||||
| @@ -965,8 +951,8 @@ def Destroy(self, *args, **kwargs): | ||||||
| # MPLBACKEND=wxagg python -c 'from pylab import *; plot()'. | ||||||
| if self and not self.IsBeingDeleted(): | ||||||
| super().Destroy(*args, **kwargs) | ||||||
| # toolbar.Destroy() should not be necessary if the close event is | ||||||
| # allowed to propagate. | ||||||
| return True | ||||||
| @@ -988,20 +974,7 @@ class FigureManagerWx(FigureManagerBase): | ||||||
| def __init__(self, canvas, num, frame): | ||||||
| _log.debug("%s - __init__()", type(self)) | ||||||
| self.frame = self.window = frame | ||||||
| super().__init__(canvas, num) | ||||||
| def show(self): | ||||||
| # docstring inherited | ||||||
| @@ -1373,6 +1346,10 @@ def trigger(self, *args, **kwargs): | ||||||
| wx.TheClipboard.Close() | ||||||
| FigureManagerWx._toolbar2_class = NavigationToolbar2Wx | ||||||
| FigureManagerWx._toolmanager_toolbar_class = ToolbarWx | ||||||
| @_Backend.export | ||||||
| class _BackendWx(_Backend): | ||||||
| FigureCanvas = FigureCanvasWx | ||||||