Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0468005

Browse filesBrowse files
dopplershiftmeeseeksmachine
authored andcommitted
Backport PR #18219: Fixes an issue where WxAgg NavigationToolbar2 broke custom toolbars
1 parent b604dec commit 0468005
Copy full SHA for 0468005

File tree

Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def _set_frame_icon(frame):
11051105

11061106

11071107
class NavigationToolbar2Wx(NavigationToolbar2, wx.ToolBar):
1108-
def __init__(self, canvas):
1108+
def __init__(self, canvas, coordinates=True):
11091109
wx.ToolBar.__init__(self, canvas.GetParent(), -1)
11101110

11111111
if 'wxMac' in wx.PlatformInfo:
@@ -1127,9 +1127,11 @@ def __init__(self, canvas):
11271127
self.Bind(wx.EVT_TOOL, getattr(self, callback),
11281128
id=self.wx_ids[text])
11291129

1130-
self.AddStretchableSpace()
1131-
self._label_text = wx.StaticText(self)
1132-
self.AddControl(self._label_text)
1130+
self._coordinates = coordinates
1131+
if self._coordinates:
1132+
self.AddStretchableSpace()
1133+
self._label_text = wx.StaticText(self)
1134+
self.AddControl(self._label_text)
11331135

11341136
self.Realize()
11351137

@@ -1334,7 +1336,8 @@ def statbar(self):
13341336
return self.GetTopLevelParent().GetStatusBar()
13351337

13361338
def set_message(self, s):
1337-
self._label_text.SetLabel(s)
1339+
if self._coordinates:
1340+
self._label_text.SetLabel(s)
13381341

13391342
def set_history_buttons(self):
13401343
can_backward = self._nav_stack._pos > 0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.