CTkToplevel not displaying
CTkToplevel is not displaying when the resizeable method is used.
customtkinter: 4.6.3
IOS: Windows 10
Steps To Reproduce
- Run the below code in a python file.
- Click the button in the main window
- Nothing happens
- Remove the
resizablemethod in the toplevel function. - The toplevel window properly displays
Observed Results
- Console does not return any errors.
- Changing the values inside the resizeable method does nothing.
- Works fine on MacOS
Code:
from customtkinter import CTk, CTkToplevel, CTkButton
root = CTk()
root.resizable(False, False)
def toplevel():
print('OPEN')
top = CTkToplevel(root)
top.resizable(False, False) # Prevents window from opening
button = CTkButton(top, command=top.destroy)
button.pack(padx=20, pady=20)
button = CTkButton(root, command=toplevel)
button.pack(padx=20, pady=20)
root.mainloop()
I ran the code you posted, it works fine (macOS). Maybe try it this way, using a class with ck.CTk inheritance:
import customtkinter as ck
ck.set_appearance_mode("dark") # Options: light, dark, auto
ck.set_default_color_theme("dark-blue") # Options: blue, dark-blue, green
class App(ck.CTk):
def __init__(self, *args, fg_color="default_theme", **kwargs):
super().__init__(*args, fg_color=fg_color, **kwargs)
self.resizable(False, False)
self.button = ck.CTkButton(self, command=self.toplevel)
self.button.pack(padx=20, pady=20)
def toplevel(self):
print("OPEN")
top = ck.CTkToplevel(self)
top.resizable(False, False) # Prevents window from opening
button = ck.CTkButton(top, command=top.destroy)
button.pack(padx=20, pady=20)
def on_closing(self, event=0):
self.destroy()
exit(0)
def start(self):
self.mainloop()
if __name__ == "__main__":
app = App()
app.start()
The ck.CTk inheritance still didnt work. Must be a windows 10 issue.
Its only a Windows 10 issue, I fixed it, and it will build a new release version soon.
Sorry,I'm on Windows 11,but the problem still exist even though the customtkinter version have up to date...
Its only a Windows 10 issue, I fixed it, and it will build a new release version soon.
Its a problem for all Windows versions, and I didn't upload a new version yet, but I will do it maybe tomorrow when some other changes are also ready.
Its a problem for all Windows versions, and I didn't upload a new version yet, but I will do it maybe tomorrow when some other changes are also ready.
Thank you!
When the fix will be updated,please?
Just here to say that the issue still persists. The standard tkinter.Toplevel() works fine but customtkinter.CTkToplevel() still doesn't work with the resizable parameters.
Should be fixed with version 5.0.0.