Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTkTopLevel #2483

Open
mcaple opened this issue Jun 22, 2024 · 3 comments
Open

CTkTopLevel #2483

mcaple opened this issue Jun 22, 2024 · 3 comments

Comments

@mcaple
Copy link

mcaple commented Jun 22, 2024

The CTkTopLevel sample does not bring the window to the front when the button is clicked. It appears behind the main window. If you click again it will be given focus and brought to front. I am running this on Windows 11. Many thanks for this project.

@TRadigk
Copy link

TRadigk commented Jun 22, 2024

One solution:
self.after(10, lambda: self.lift())

You can play around with the value of 10 ms.

@mcaple
Copy link
Author

mcaple commented Jun 23, 2024

I was toying around with using the "after" method but wanted to check as am new to the Python GUI world.

Thanks once again

@mate02102003
Copy link

I have tracked down why that is the behavior. In the ctk_toplevel.py from line 275-277 on windows it gives back the focus to the widget which had the the focus before withdraw, In this case the the app created in main.

This migth have been a fix for something else when the window is already created, when you want to change the appearance of the title bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants