Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Function 'addCheckBox' doesn't provide a text argument different from the title #161
Function 'addCheckBox' doesn't provide a text argument different from the title. The problem with this is that the title and text of the CheckBox widget is the same, therefore when creating multiple CheckBox widgets with the same text string an exception will be thrown due to duplicate key. Other widgets like addLabel provide arguments for both title and text, which allows to have multiple label with the same text string.
Exception in Tkinter callback
File "test.py", line 12, in
How to Reproduce it
To show the issue, this code will create a Tabbed Frame with two Tabs that contains the same fields: a label and a checkbox. They idea is to be able to create clone tabs that will have similar fields inside each tab. In this particular case, notice that for the addCheckBox there is no way to specify the title and text in order to differentiate between the two CheckBox widgets.
from appJar import gui
app = gui("Sample Tap")
I added an new parameter "text" and configured the default value for text. Looks like this solves the problem. Just replace the addCheckBox code with this:
Thank you for this. Unfortunately, it will break backwards compatibility - anyone who upgrades and is already using checkboxes, and has specified a row/column/etc will have issues...
But, you're right, this is an issue. We did a similar thing with buttons back in the day - introducing
I'll add it to the list for the next release.