123456789101112131415161718192021222324252627282930 |
- import tkinter as tk
- import time
- from graph import Graph
- class MainWindow(tk.Frame):
- def __init__(self, root):
- self.root = root
- tk.Frame.__init__(self, root)
- self.graph = Graph(self)
- self.graph.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
- self.controls = tk.Frame(self)
- self.controls.pack(fill=tk.BOTH, side=tk.RIGHT)
- l = tk.Label(self.controls, text="your widgets go here...", anchor="c")
- l.pack(side="top", fill="both", expand=True)
- def update(self):
- self.graph.update()
- self.root.after(30, self.update)
- if __name__ == "__main__":
- root = tk.Tk()
- root.title("Tracking System")
- view = MainWindow(root)
- view.pack(side="top", fill="both", expand=True)
- view.update()
- root.mainloop()
|