Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is 'tk::placeWindow' and how can it center the window on my screen?

Im trying to find a way to center the window of a simple counter I made using Tkinter. Trying to find another way than using geometry I came across:

window.eval('tk::placeWindow . center')

But I don’t know why this works and also I cant find it in the documentation. Anyone knows the answer?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The code below executes code that is written in tcl and calls a tcl procedure. There are quite a few of them, but they mostly used for internal procedures and rarely useful.

window.eval('tk::placeWindow . center')

The placeWindow procedure can be found here and does nothing that you couldn’t do with python. They are most likely for maintainers that are used to tcl.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading