(self, toolmanager, window=None)
| 1014 | |
| 1015 | class ToolbarTk(ToolContainerBase, tk.Frame): |
| 1016 | def __init__(self, toolmanager, window=None): |
| 1017 | ToolContainerBase.__init__(self, toolmanager) |
| 1018 | if window is None: |
| 1019 | window = self.toolmanager.canvas.get_tk_widget().master |
| 1020 | xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx |
| 1021 | height, width = 50, xmax - xmin |
| 1022 | tk.Frame.__init__(self, master=window, |
| 1023 | width=int(width), height=int(height), |
| 1024 | borderwidth=2) |
| 1025 | self._label_font = tkinter.font.Font(size=10) |
| 1026 | # This filler item ensures the toolbar is always at least two text |
| 1027 | # lines high. Otherwise the canvas gets redrawn as the mouse hovers |
| 1028 | # over images because those use two-line messages which resize the |
| 1029 | # toolbar. |
| 1030 | label = tk.Label(master=self, font=self._label_font, |
| 1031 | text='\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}') |
| 1032 | label.pack(side=tk.RIGHT) |
| 1033 | self._message = tk.StringVar(master=self) |
| 1034 | self._message_label = tk.Label(master=self, font=self._label_font, |
| 1035 | textvariable=self._message) |
| 1036 | self._message_label.pack(side=tk.RIGHT) |
| 1037 | self._toolitems = {} |
| 1038 | self.pack(side=tk.TOP, fill=tk.X) |
| 1039 | self._groups = {} |
| 1040 | |
| 1041 | def _rescale(self): |
| 1042 | return NavigationToolbar2Tk._rescale(self) |
nothing calls this directly
no test coverage detected