[pygtk] Combobox with thousands of rows

Rob Brown-Bayliss r.brown.bayliss at gmail.com
Thu Mar 26 14:43:29 WST 2009


Hi.  

I need a way to let users pick one of approx 8000 names from a list and
had thought to use a combobox but it is far too slow taking several
seconds to pop up, and scrolling is unusable.

Does any one have an idea or solution that does not take up too much
screen space.

here is the code I was usign to load the list:

		custs = self.DB.select("SELECT CAST(Customer_Key as TEXT), CAST(Name
as Text) FROM Customer Order By Name")
                cust_list =
gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING)
		if custs != None:
			for c in custs:
				n = c[1].strip()
				row = (unicode(n),c[0])
				cust_list.append(row)       	
		self.customer.set_model(cust_list)	



--
Rob Brown-Bayliss

http://globalvillage.sourceforge.net 
The world at your finger tips...


____________________________________
The French don't have a word for
entrepreneur. -- George W Bush
____________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090326/acda193d/attachment.htm 


More information about the pygtk mailing list