hi
just give
for i in range(*0*,len(self.text)): instead of for i in
range(len(self.text)):
The simple to do this is:
def loadlist(self):
self.text= self.con.getSelectionlist()
for i in range(0,len(self.text)):
self.combobox.append_text(self.text[i])
Njoy the share of Freedom,
Anusha Kadambala
On Mon, Apr 13, 2009 at 6:10 PM, ganesh gajare
<[email protected]>wrote:
> 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.
>
> _______________________________________________
> pygtk mailing list [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/