Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7362573 commit f8b73d6Copy full SHA for f8b73d6
examples/user_interfaces/embedding_in_tk_sgskip.py
@@ -26,7 +26,8 @@
26
canvas = FigureCanvasTkAgg(fig, master=root) # A tk.DrawingArea.
27
canvas.draw()
28
29
-toolbar = NavigationToolbar2Tk(canvas, root)
+# pack_toolbar=False will make it easier to use a layout manager later on.
30
+toolbar = NavigationToolbar2Tk(canvas, root, pack_toolbar=False)
31
toolbar.update()
32
33
@@ -44,6 +45,7 @@ def on_key_press(event):
44
45
# The canvas is rather flexible in its size, so we pack it last which makes
46
# sure the UI controls are displayed as long as possible.
47
button.pack(side=tkinter.BOTTOM)
48
+toolbar.pack(side=tkinter.BOTTOM, fill=tkinter.X)
49
canvas.get_tk_widget().pack(side=tkinter.TOP, fill=tkinter.BOTH, expand=1)
50
51
tkinter.mainloop()
0 commit comments