mainWindow.py 744 B

123456789101112131415161718192021222324252627282930
  1. import tkinter as tk
  2. import time
  3. from graph import Graph
  4. class MainWindow(tk.Frame):
  5. def __init__(self, root):
  6. self.root = root
  7. tk.Frame.__init__(self, root)
  8. self.graph = Graph(self)
  9. self.graph.pack(fill=tk.BOTH, side=tk.LEFT, expand=True)
  10. self.controls = tk.Frame(self)
  11. self.controls.pack(fill=tk.BOTH, side=tk.RIGHT)
  12. l = tk.Label(self.controls, text="your widgets go here...", anchor="c")
  13. l.pack(side="top", fill="both", expand=True)
  14. def update(self):
  15. self.graph.update()
  16. self.root.after(30, self.update)
  17. if __name__ == "__main__":
  18. root = tk.Tk()
  19. root.title("Tracking System")
  20. view = MainWindow(root)
  21. view.pack(side="top", fill="both", expand=True)
  22. view.update()
  23. root.mainloop()