Hi,
I did a simple test to use tkinter in grasshopper with Rhino 8. Currently I need to close the interface for the data to pass. But I would like to be able to keep the interface open and when I click on the button the data is passed to grasshopper.
import customtkinter as ctk
def on_calculate():
value_a = entry_a.get()
print(f"Valeur de a : {value_a}")
# Init
app = ctk.CTk()
app.geometry("300x200")
app.title("UserForm")
# Value a
label_a = ctk.CTkLabel(app, text="Value :")
label_a.pack(pady=10)
entry_a = ctk.CTkEntry(app)
entry_a.pack(pady=10)
#Set button
button_calculate = ctk.CTkButton(app, text="Calculate", command=on_calculate)
button_calculate.pack(pady=20)
print (button_calculate)
app.mainloop()
Thanks for ur help !