my tkinter gui is invisible for unknown reasons

六月ゝ 毕业季﹏ 提交于 2019-12-11 23:24:53

问题


I've been trying to create a basic gui using tkinter, I've done it before on a different computer but for some reason its invisible. Is there something wrong with my code or the computer (windows)?

import sys
from tkinter import *
mygui = Tk()
mygui.geometry('300x300+0+982')
mygui.title("my gui")
mygui.mainloop()

回答1:


Is your screen height is bigger than 982 pixel?

Following line place the window at (0, 982) with width 300, height 300. If your screen height smaller than 982 pixel, you can't see it.

mygui.geometry('300x300+0+982')

Replace it with following:

mygui.geometry('300x300+0+0')

and you will see it.



来源:https://stackoverflow.com/questions/20585560/my-tkinter-gui-is-invisible-for-unknown-reasons

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