コード例 #1
0
    def _init_toolbar(self):
        xmin, xmax = self.canvas.figure.bbox.intervalx
        height, width = 50, xmax - xmin
        Tk.Frame.__init__(self,
                          master=self.window,
                          width=int(width),
                          height=int(height),
                          borderwidth=2)

        self.update()  # Make axes menu

        for text, tooltip_text, image_file, callback in self.toolitems:
            if text is None:
                # spacer, unhandled in Tk
                pass
            else:
                button = self._Button(text=text,
                                      file=image_file,
                                      command=getattr(self, callback))
                if tooltip_text is not None:
                    ToolTip.createToolTip(button, tooltip_text)

        self.message = Tk.StringVar(master=self)
        self._message_label = Tk.Label(master=self, textvariable=self.message)
        self._message_label.pack(side=Tk.RIGHT)
        self.pack(side=Tk.BOTTOM, fill=Tk.X)
コード例 #2
0
 def __init__(self, window, *args, **kwargs):
     StatusbarBase.__init__(self, *args, **kwargs)
     xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
     height, width = 50, xmax - xmin
     Tk.Frame.__init__(self, master=window,
                       width=int(width), height=int(height),
                       borderwidth=2)
     self._message = Tk.StringVar(master=self)
     self._message_label = Tk.Label(master=self, textvariable=self._message)
     self._message_label.pack(side=Tk.RIGHT)
     self.pack(side=Tk.TOP, fill=Tk.X)