简体   繁体   English

我的tkinter gui因未知原因而隐形

[英]my tkinter gui is invisible for unknown reasons

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. 我一直在尝试使用tkinter创建一个基本的gui,我之前已经在另一台计算机上做到了,但是由于某种原因它是不可见的。 Is there something wrong with my code or the computer (windows)? 我的代码或计算机(Windows)有问题吗?

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

Is your screen height is bigger than 982 pixel? 屏幕高度是否大于982像素?

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. 接下来,将窗口放置在宽度为300,高度为300的(0,982)处。如果屏幕高度小于982像素,则看不到它。

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

Replace it with following: 将其替换为以下内容:

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

and you will see it. 您将看到它。

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

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