[pygtk] clearing combo box value

Arun p das arunpdasuit at gmail.com
Tue Dec 13 21:04:19 WST 2011


>From the text box i am reading key values and appending into store and
later i am setting the combobox model as the store i created. The
problem here is all values are repeating along with the added value (
list of values are duplicating inside the combobox ) what to do with
this? Is there any function to clear the store values ?

a
b
c

after adding value "d" i am getting

a  a
b  b
c  c
d d

 def DescribeKeypair(self):
        .....................
        .................
         cbox = self.builder.get_object("key_namecombo")
		while i<len(keylist) :
			#=================Key add to combobox=============
			store.append([keylist[i][0]])	
			#=================================================
			i=i+1
		cbox.set_model(store)
		cell = gtk.CellRendererText()
		cbox.pack_start(cell, True)
		cbox.add_attribute(cell, 'text', 0)
		cbox.set_active(0)


I am using list inside list


More information about the pygtk mailing list