问题
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