开发者

Making windows not appear over each other

开发者 https://www.devze.com 2023-02-02 01:18 出处:网络
Is there a way to check if part开发者_运维技巧 or an entire window is over/under another window in python?

Is there a way to check if part开发者_运维技巧 or an entire window is over/under another window in python?

I have two windows and I'd like to make them not appear over each other. This is in Windows, using Tkinter.


You can use the methods winfo_rootx and winfo_rooty to get the x/y in the upper left corner. You can use winfo_width and winfo_height to get the width and height of the window. From that it's just a little math to figure out if two windows overlap. You can then use the geometry method to position the windows anywhere on the screen.

0

精彩评论

暂无评论...
验证码 换一张
取 消