<list> prefs item doesn't save software-created items
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
gDesklets | Status tracked in 0.3x | |||||
0.3x |
Confirmed
|
High
|
gDesklets Core Team |
Bug Description
I'm trying to add items to a <list> preferences setting when the user fills out a form and presses a button. So I do something like this in the button callback:
def addToList():
global my_list
if Prefs.lbl.value:
my_
Prefs.
my_list is bound to Prefs.my_list, lbl is bound to Prefs.lbl.
This code adds items to the list but doesn't bring them back when I restart the desklet. Some debugging 'print' statements tell me that my_list is populated on the restart, but they don't appear in the prefs dialog nor is Prefs.my_list.items populated with anything. The prefs code is:
<button label="Add item" callback=
<list label="Test list:" id="my_list" callback=
<!-- items go here, empty to begin with -->
<item id="default"/>
</list>
I remember running into this one, too.
Tried to fix it back then when starting to write ConfigList (back in 2004/5) but couldn't figure it out back then :/.
Maybe the other Configuration elements using lists (like ConfigTogle) have the same problem ?!