Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopening subWindow from buttom causes 'Duplicate widgetName' error #636

Open
ATrashInTheWorld opened this issue Apr 17, 2021 · 0 comments

Comments

@ATrashInTheWorld
Copy link

Bug Report


When I try to reopen a subWindow from a button, after closing it once, an error is thrown.

Context


Replace this with a bit of background on what you're doing. I am trying to create an app that opens subWindows for different purposes. When the user is done, he closes the subWindow, and can reopen it to restart.

Expected Behaviour


After closing the subWindow once, the user should be able to reopen it again.

Actual Behaviour


After closing it once, an error is thrown and the subWindow does not reopen when I click the button.

Any error messages produced by appJar


Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "/home/dragonbug/.local/lib/python3.6/site-packages/appJar/appjar.py", line 3783, in <lambda>
    return lambda *args: funcName(param)
  File "/home/dragonbug/REPOS/japanesQuizzGenerator/src/GUI.py", line 53, in click
    createKanjiBank()
  File "/home/dragonbug/REPOS/japanesQuizzGenerator/src/GUI.py", line 29, in createKanjiBank
    app.startSubWindow("kanji", modal=True)
  File "/home/dragonbug/.local/lib/python3.6/site-packages/appJar/appjar.py", line 5680, in startSubWindow
    self.widgetManager.verify(WIDGET_NAMES.SubWindow, name)
  File "/home/dragonbug/.local/lib/python3.6/site-packages/appJar/appjar.py", line 15862, in verify
    raise ItemLookupError("Duplicate widgetName: " + widgetName)
appJar.appjar.ItemLookupError: Duplicate widgetName: kanji

Sample code, demonstrating the issue


def createKanjiBank():
    print("create Kanji Bank")
    kanjiBank = []
    app.startSubWindow("kanji", modal=True)
    # app.setStopFunction(closeSubWindow)
    app.setSize(600,400)
    app.showSubWindow("kanji", "")
    # addToolBarButtons()
    app.addButton("+", addNewKanji)
    app.startScrollPane("Kanji Bank")
    for kanji in kanjiBank:
        app.addLabel(kanji.getKanji(), kanji.toString())

def click(button):
    if button == "Create new Kanji bank":
        createKanjiBank()

app = gui("Japanese Quizz Generator", "500x350")
app.addButton("Create new Kanji bank", click)
app.go()

What steps are needed to reproduce the bug


  • Start the app
  • Click on the button
  • close the subWindow
  • Click on the button again

Version Information


appJar: 0.94.0 Python: 3.6.9 TCL: 8.6, TK: 8.6 Platform: Linux pid: 28319
locale: en_CA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant