简体   繁体   English

显示Tkinter窗口大于桌面

[英]Showing Tkinter window larger than desktop

I need to show Tkinter window, which I create with Tk(), to be larger than desktop, and moved to some coordinates outside the desktop. 我需要显示用Tk()创建的Tkinter窗口,该窗口要大于桌面,并移至桌面外部的某些坐标。

Unfortunately when I do: 不幸的是,当我这样做时:

root = tk.Tk()
root.geometry("%dx%d+%d+%d", (10000, 10000, -300, -300))

then this window shows up, but maximized on desktop. 然后会显示此窗口,但在桌面上会最大化。

When I show the window at first, and resize/move later, then everything is OK, but I don't want to see the small empty window at the beginning. 当我首先显示该窗口,然后再调整大小/移动时,则一切正常,但是我不想一开始就看到小的空白窗口。

How can I show the window with the coordinates and size at the very beginning? 如何在开始时显示带有坐标和大小的窗口?

Here's an example: 这是一个例子:

from Tkinter import Tk

root = Tk()

root.withdraw()
root.update_idletasks()

root.geometry("+-1000+-1000")
root.minsize(2000, 2000)

root.deiconify()

root.mainloop()

withdraw hides the window, deiconify shows it. withdraw隐藏窗口,去deiconify显示它。

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM