[英]appjar close login window open chat window python
I have an appjar python application that is supposed to have a login window and another window that opens after you login. 我有一个appjar python应用程序,应该有一个登录窗口,并且在登录后会打开另一个窗口。 The login window works, but when I try to call the function for the second window I get maximum recursion depth exceeded.
登录窗口有效,但是当我尝试为第二个窗口调用该函数时,得到的最大递归深度超过了。 console error
控制台错误
from appjar import gui
def loginButton(button):
if button == "Cancel":
app.stop()
else:
usr = app.getEntry("Username")
pwd = app.getEntry("Password")
login(usr,pwd)
def login(usr,pwd):
if usr == "1" and pwd == "1":
app.stop()
print ("Success go to next gui")
chatGUI(usr)
else:
addLoginErrorMessage()
def addLoginErrorMessage():
app.opengui("Custon IRC Login")
app.addLabel("ErrorLabel", "Wrong username or password.")
def chatGUI(usr):
app = chatGUI("Custom IRC")
##app.addLabelOptionBox("Select Server", ["127.0.0.1"], 0, 0, 1)
##app.addListBox("chatBox",1, 0, 3, 2)
##app.addEntry("chatInput", 3, 0, 3)
app.go()
app = gui("Custom IRC Login")
app.addLabelEntry("Username")
app.addLabelSecretEntry("Password")
app.addButtons(["Submit", "Cancel"], loginButton)
app.go()
You need to look into SubWindows: http://appjar.info/pythonSubWindows/ 您需要研究SubWindows: http ://appjar.info/pythonSubWindows/
Creating multiple apps isn't really supported, and will break things... 确实不支持创建多个应用,这会破坏工作...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.