-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prototype gui with some front end, no back end yet
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import tkinter as tk | ||
from tkinter import ttk | ||
|
||
def option_selected(event): | ||
print(f"Selected: {dropdown_var.get()}") | ||
|
||
def show_circuit_works(): | ||
display_label.config(text="Circuit works", fg="green") | ||
|
||
def show_circuit_not_work(): | ||
display_label.config(text="Circuit does not work", fg="red") | ||
|
||
root = tk.Tk() | ||
root.title("Circut GUI Prototype") | ||
|
||
# drop-down menu | ||
dropdown_var = tk.StringVar() | ||
dropdown = ttk.Combobox(root, textvariable=dropdown_var) | ||
dropdown['values'] = ('Option 1', 'Option 2', 'Option 3') | ||
dropdown.grid(row=0, column=0, padx=10, pady=10) | ||
dropdown.bind("<<ComboboxSelected>>", option_selected) | ||
|
||
# display label | ||
display_label = tk.Label(root, text="", font=("Arial", 14)) | ||
display_label.grid(row=1, column=0, columnspan=3, padx=10, pady=10) | ||
|
||
# buttons | ||
button1 = tk.Button(root, text="Circuit Works", command=show_circuit_works) | ||
button1.grid(row=2, column=0, padx=10) | ||
|
||
button2 = tk.Button(root, text="Circuit Does Not Work", command=show_circuit_not_work) | ||
button2.grid(row=2, column=1, padx=10) | ||
|
||
button3 = tk.Button(root, text="Button 3") | ||
button3.grid(row=2, column=2, padx=10) | ||
|
||
root.mainloop() |