|
1 | 1 | import tkinter as tk |
2 | 2 | from tkinter import ttk |
3 | | -from tkinter.ttk import * |
4 | 3 |
|
5 | | -root = tk.Tk() |
6 | | -root.geometry('600x400') |
7 | | -root.title("Tab Widget") |
| 4 | +# Constants |
| 5 | +WINDOW_SIZE = "600x400" |
| 6 | +APP_TITLE = "Session Analysis" |
8 | 7 |
|
9 | | -notebook = ttk.Notebook(root) |
10 | | -live_track = ttk.Frame(notebook) |
11 | | -session_his = ttk.Frame(notebook) |
12 | | -notebook.add(live_track, text = 'Live Tracking') |
13 | | -notebook.add(session_his, text = 'Session History') |
14 | 8 |
|
15 | | -notebook.pack() |
| 9 | +def build_live_tracking_tab(parent): |
| 10 | + """Build the Live Tracking tab interface.""" |
| 11 | + frame = ttk.Frame(parent, padding=10) |
| 12 | + ttk.Label(frame, text="Live Tracking — TODO").pack(anchor="w") |
| 13 | + # TODO: Add live tracking functionality here |
| 14 | + return frame |
16 | 15 |
|
17 | 16 |
|
18 | | -root.mainloop() |
| 17 | +def build_session_history_tab(parent): |
| 18 | + """Build the Session History tab interface.""" |
| 19 | + frame = ttk.Frame(parent, padding=10) |
| 20 | + ttk.Label(frame, text="Session History — TODO").pack(anchor="w") |
| 21 | + # TODO: Add session history functionality here |
| 22 | + return frame |
| 23 | + |
| 24 | + |
| 25 | +def main(): |
| 26 | + """Main application entry point.""" |
| 27 | + root = tk.Tk() |
| 28 | + root.geometry(WINDOW_SIZE) |
| 29 | + root.title(APP_TITLE) |
| 30 | + |
| 31 | + notebook = ttk.Notebook(root) |
| 32 | + |
| 33 | + # Build tabs using helper functions |
| 34 | + live_track = build_live_tracking_tab(notebook) |
| 35 | + session_his = build_session_history_tab(notebook) |
| 36 | + |
| 37 | + notebook.add(live_track, text="Live Tracking") |
| 38 | + notebook.add(session_his, text="Session History") |
| 39 | + notebook.pack(expand=True, fill="both") |
| 40 | + |
| 41 | + root.mainloop() |
| 42 | + |
| 43 | + |
| 44 | +if __name__ == "__main__": |
| 45 | + main() |
0 commit comments