arnau_op/test_gui.py

39 lines
1.1 KiB
Python

import tkinter as tk
w = tk.Tk()
p_nameVar = tk.StringVar(w)
cpusVar = tk.StringVar(w)
cycVar = tk.StringVar(w)
N_tsVar = tk.StringVar(w)
T_cycVar = tk.StringVar(w)
settings = 0
def getvars():
p_name = p_nameVar.get()
cpus = cpusVar.get()
cyc = cycVar.get()
N_ts = N_tsVar.get()
T_cyc = T_cycVar.get()
settings = (p_name, cpus, cyc, N_ts, T_cyc)
print(settings)
field1 = tk.Label(w, text="project name").grid(row=0, column=0)
entry1 = tk.Entry(w, textvariable = p_nameVar).grid(row=0, column=1)
field2 = tk.Label(w, text="CPUs").grid(row=1, column=0)
entry2 = tk.Entry(w, textvariable = cpusVar).grid(row=1, column=1)
field3 = tk.Label(w, text="number of cycles").grid(row=2, column=0)
entry3 = tk.Entry(w, textvariable = cycVar).grid(row=2, column=1)
field4 = tk.Label(w, text="number of time steps").grid(row=3, column=0)
entry4 = tk.Entry(w, textvariable = N_tsVar).grid(row=3, column=1)
field5 = tk.Label(w, text="cycle periode").grid(row=4, column=0)
entry5 = tk.Entry(w, textvariable = T_cycVar).grid(row=4, column=1)
button = tk.Button(w, text="Get vars", command=getvars).grid(row=5)
w.mainloop()