From c81b64e0fd201a796cc4e59e1401b4b7c3371c52 Mon Sep 17 00:00:00 2001 From: xaloc Date: Wed, 8 Jan 2020 14:12:15 +0100 Subject: [PATCH] add gui test file gui not working for now, it only has labels and entry and cannot retrive info from entries --- test_gui.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test_gui.py diff --git a/test_gui.py b/test_gui.py new file mode 100644 index 0000000..299a619 --- /dev/null +++ b/test_gui.py @@ -0,0 +1,38 @@ +import tkinter as tk + +w = tk.Tk() + +p_name = tk.StringVar(w) +cpus = tk.StringVar(w) +cyc = tk.StringVar(w) +N_ts = tk.StringVar(w) +T_cyc = tk.StringVar(w) + +def getvars(p_name, cpus, cyc, N_ts, T_cyc): + p_name = p_name.get() + cpus = cpus.get() + cyc = cyc.get() + N_ts = N_ts.get() + T_cyc = T_cyc.get() + + print(T_cyc) + +field1 = tk.Label(w, text="project name").grid(row=0, column=0) +entry1 = tk.Entry(w, textvariable = p_name).grid(row=0, column=1) + +field2 = tk.Label(w, text="CPUs").grid(row=1, column=0) +entry2 = tk.Entry(w, textvariable = cpus).grid(row=1, column=1) + +field3 = tk.Label(w, text="number of cycles").grid(row=2, column=0) +entry3 = tk.Entry(w, textvariable = cyc).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_ts).grid(row=3, column=1) + +field5 = tk.Label(w, text="cycle periode").grid(row=4, column=0) +entry5 = tk.Entry(w, textvariable = T_cyc).grid(row=4, column=1) + +button = tk.Button(w, text="Get vars", command=getvars(p_name, cpus, cyc, N_ts, T_cyc)).grid(row=5) + + +w.mainloop()