appjar关闭登录窗口打开聊天窗口python

2024-10-05 10:35:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个appjarpython应用程序,它应该有一个登录窗口和另一个在您登录后打开的窗口。登录窗口可以工作,但是当我尝试调用第二个窗口的函数时,我得到了超过最大递归深度的结果。 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()

Tags: appgoifusrdefircpwdgui

热门问题