示例#1
0
    def __init__(self, windowWidth, windowHeight, xMin, xMax, yMin, yMax,
                 title):
        # start tk if it hasn't been done already
        tk.init()
	self.title = title
        # Make a window to draw on
        self.top=Tkinter.Toplevel()
        self.top.wm_title(title)
        self.top.protocol('WM_DELETE_WINDOW', self.destroy)
	self.windowWidth = windowWidth
        self.windowHeight = windowHeight
        self.canvas = Tkinter.Canvas(self.top, width=self.windowWidth,
                                     height=self.windowHeight, 
                                     background="white")
        self.canvas.pack()
#        self.save_btn = Tkinter.Button(self.top, text="Save",
#                                       command=self.save)
#        self.save_btn.pack()
        self.xMin = xMin
        self.yMin = yMin
        self.xMax = xMax if xMax else width
        self.yMax = yMax if yMax else height

        # multiply an input value by this to get pixels
        self.xScale = windowWidth / float(self.xMax - self.xMin)
        self.yScale = windowHeight / float(self.yMax - self.yMin)
示例#2
0
 def __init__(self, width, height, xmin, xmax, ymin, ymax,
              title="", parent=None, 
              xminlabel=0, xmaxlabel=0, timeStamp = True):
     # start tk if it hasn't been done already
     tk.init()
     self.openWindow(width, height, xmin, xmax, ymin, ymax,
                     title, parent, xminlabel, xmaxlabel, timeStamp)
示例#3
0
    def __init__(self, windowWidth, windowHeight, xMin, xMax, yMin, yMax,
                 title):
        # start tk if it hasn't been done already
        tk.init()
        self.title = title
        # Make a window to draw on
        self.top = Tkinter.Toplevel()
        self.top.wm_title(title)
        self.top.protocol('WM_DELETE_WINDOW', self.destroy)
        self.windowWidth = windowWidth
        self.windowHeight = windowHeight
        self.canvas = Tkinter.Canvas(self.top,
                                     width=self.windowWidth,
                                     height=self.windowHeight,
                                     background="white")
        self.canvas.pack()
        #        self.save_btn = Tkinter.Button(self.top, text="Save",
        #                                       command=self.save)
        #        self.save_btn.pack()
        self.xMin = xMin
        self.yMin = yMin
        self.xMax = xMax if xMax else width
        self.yMax = yMax if yMax else height

        # multiply an input value by this to get pixels
        self.xScale = windowWidth / float(self.xMax - self.xMin)
        self.yScale = windowHeight / float(self.yMax - self.yMin)
示例#4
0
 def __init__(self,
              width,
              height,
              xmin,
              xmax,
              ymin,
              ymax,
              title="",
              parent=None,
              xminlabel=0,
              xmaxlabel=0,
              timeStamp=True):
     # start tk if it hasn't been done already
     tk.init()
     self.openWindow(width, height, xmin, xmax, ymin, ymax, title, parent,
                     xminlabel, xmaxlabel, timeStamp)