CustomTkinter
CustomTkinter copied to clipboard
TypeError: CTkBaseClass.update_dimensions_event() missing 1 required positional argument: 'event'
Mr. Tom, thank you so much for taking time out of your personal life building such an amazing product. We do appreciate you.
I'm encountering some errors while implementing buttons, could you please guide me through!
import customtkinter customtkinter.set_appearance_mode("System") # Modes: system (default), light, dark customtkinter.set_default_color_theme("blue") # Themes: blue (default), dark-blue, green
app = customtkinter.CTk() # create CTk window like you do with the Tk window app.geometry("400x240")
def button_function(): print("button pressed")
Use CTkButton instead of tkinter Button
button = customtkinter.CTkButton(master=app, text="CTkButton", command=button_function) button.place(relx=0.5, rely=0.5, anchor=customtkinter.CENTER)
app.mainloop()
-----------------------------------Terminal Error------------------------------ Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\houma\AppData\Local\Programs\Python\Python311\Lib\tkinter_init_.py", line 1948, in call return self.func(*args) ^^^^^^^^^^^^^^^^ TypeError: CTkBaseClass.update_dimensions_event() missing 1 required positional argument: 'event'
----------------------------------- init.py ---------------------------------- 1943 def call(self, *args): 1944 """Apply first function SUBST to arguments, than FUNC.""" 1945 try: 1946 if self.subst: 1947 args = self.subst() 1948 return self.func(*args) 1949 except SystemExit: 1950 raise 1951 except: 1952 self.widget._report_exception()
Reformatted for readability.
Personally not seeing anything in the code that should cause this, I have no issues with Python 3.11 with either the current release or dev branch running this.