Sean
Sean

Reputation: 1

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. 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()

Upvotes: 0

Views: 242

Answers (1)

R.Jarvis
R.Jarvis

Reputation: 273

You need to look into SubWindows: http://appjar.info/pythonSubWindows/

Creating multiple apps isn't really supported, and will break things...

Upvotes: 0

Related Questions