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

Autoentry with empty initial list error #631

Open
regob opened this issue Jul 31, 2020 · 1 comment
Open

Autoentry with empty initial list error #631

regob opened this issue Jul 31, 2020 · 1 comment

Comments

@regob
Copy link

regob commented Jul 31, 2020

Bug Report

If I create an Autoentry with an empty list, and then I want to change its list, I get an error, that the entry is not an Autoentry.

Any error messages produced by appJar

appJar:ERROR [Line 1733->10123/changeAutoEntry]: You can only change items in an AutoEntry, A is not an AutoEntry.

Sample code, demonstrating the issue

from appJar import gui

app = gui(" ", "400x200")

app.addAutoEntry("A", [])
app.changeAutoEntry("A", ["asdfd", "qwerty"])

app.go()

What steps are needed to reproduce the bug

Run the sample code.

Version Information

appJar: 0.94.0 Python: 3.6.10 TCL: 8.6, TK: 8.6 Platform: Linux pid: 13020
locale: en_US

@jarvisteach
Copy link
Owner

You're right!

This is by design, but I think the design is wrong:

if len(words) > 0:
             ent = self._makeAutoCompleteEntry()(words, self._getTopLevel(), frame)
         else:
             var = StringVar(self.topLevel)
             ent = entryBase(frame, textvariable=var)

It currently uses the length of the words variable to determiner the type of entry.

That should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants