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 c6a9b5d

Browse filesBrowse files
authored
Merge pull request #7442 from DavidA94/TkSpacer
Added spacer to Tk toolbar
2 parents 187a881 + 1d54580 commit c6a9b5d
Copy full SHA for c6a9b5d

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+8
-2
lines changed

‎lib/matplotlib/backends/backend_tkagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_tkagg.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,12 @@ def _Button(self, text, file, command, extension='.gif'):
750750
b.pack(side=Tk.LEFT)
751751
return b
752752

753+
def _Spacer(self):
754+
# Buttons are 30px high, so make this 26px tall with padding to center it
755+
s = Tk.Frame(master=self, height=26, relief=Tk.RIDGE, pady=2, bg="DarkGray")
756+
s.pack(side=Tk.LEFT, padx=5)
757+
return s
758+
753759
def _init_toolbar(self):
754760
xmin, xmax = self.canvas.figure.bbox.intervalx
755761
height, width = 50, xmax-xmin
@@ -761,8 +767,8 @@ def _init_toolbar(self):
761767

762768
for text, tooltip_text, image_file, callback in self.toolitems:
763769
if text is None:
764-
# spacer, unhandled in Tk
765-
pass
770+
# Add a spacer -- we don't need to use the return value for anything
771+
self._Spacer()
766772
else:
767773
button = self._Button(text=text, file=image_file,
768774
command=getattr(self, callback))

0 commit comments

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