Showing Tkinter window larger than desktop

早过忘川 提交于 2019-12-07 22:59:04

问题


I need to show Tkinter window, which I create with Tk(), to be larger than desktop, and moved to some coordinates outside the desktop.

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?


回答1:


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.

Hope that helps.



来源:https://stackoverflow.com/questions/17327678/showing-tkinter-window-larger-than-desktop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!