Skip to content

Commit

Permalink
prototype gui with some front end, no back end yet
Browse files Browse the repository at this point in the history
  • Loading branch information
stc19007 authored Oct 23, 2024
1 parent 88910a0 commit 6968721
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions SDPPython/prototype.py
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()

0 comments on commit 6968721

Please sign in to comment.