[pygtk] how to load values one by one selecting from database in combobox of glade file?
ganesh gajare
gnowledge.ganesh at gmail.com
Mon Apr 13 20:40:05 WST 2009
Hello,
We are trying to load list values from database into our combobox widget
which we created using glade.
def loadlist(self):
self.text= self.con.getSelectionlist()
print "List: %s " %self.text
for i in range(len(self.text)):
print i,self.text[i].keys()
print len(self.text[i].values())
self.val=self.text[i].values()
return self.val[1]
The above function will iterate through the list and will return the list
values to the calling function given below:
self.l=self.db.loadlist()
self.sel.get_widget('lists').append_text(self.l)
Now, if the return statement is inside for loop ...then the value getting
passed is only the first list value.
and if the return statement is outside the for loop...then the last list
value is passed to the calling function.
Our main aim is to pass the individual list elements one by one and append
them to the combobox widget.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090413/464b269f/attachment.htm
More information about the pygtk
mailing list