Tkinter GUI - deiconify() 来自另一个模块中的顶级窗口类的顶级窗口 [英] Tkinter GUI - deiconify() top level window from a top level window class in another module
问题描述
所以我认为这是可能的,但我不确定......我正在为我的程序创建一个登录系统,主屏幕是一个 Tinter GUI 根窗口,当它被创建时,它是 .withdraw() 并打开顶级登录窗口(这存储在一个类中的另一个模块中).当登录顶级窗口中的用户名和密码正确时,我想从登录窗口类的方法中 .deiconify() 根窗口.这可能吗,如果可以,如何....抱歉,我没有带代码,所以现在无法上传谢谢!
So i think this is possible but I'm not sure... Im creating a login system for my program, the main screen is a tinter GUI root window, when this is created it is then .withdraw() and the top level login window is opened (this is stored in another module in a class). When the username and password are correct in the login top level window i want to .deiconify() the root window from within a method of the login window class. Is this possible and if so how.... Sorry i haven't got the code with me so can't upload any right now Thank You!
推荐答案
当然有可能.只需调用 root.deiconify()
.您可以将 root
作为参数传递给登录窗口,也可以将其设为全局变量.
Sure it's possible. Just call root.deiconify()
. You can either pass root
as a parameter to the login window, or make it a global variable.
这篇关于Tkinter GUI - deiconify() 来自另一个模块中的顶级窗口类的顶级窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!