[Glade-users] gtk.CellRendererText()

Arthur Shats ashats at hotmail.com
Thu Sep 23 22:16:52 EDT 2010


Could somebody explain to me what gtk.CellRendererText() is for and when would I need to use it? I can't find a good explanation on this anywhere.
I have a comboBox created in Glade and the items are assigned the values from a file. Those values are country codes and names, like 
AU Austria
BR Brazil
UK United Kingdom
 
Here is my Python code sample that displays those:
 
combo = wtree.get_widget('myComboboxFromGlade')
store = gtk.ListStore(str)
combo.set_model(store)
while infile:
   line = infile.readline()
   store.append([line])
 
When user picks from the combo box list, the whole item (the country code and the name) is displayed, like 'BR Brazil'. What I need to do is when selected, only country code to appear as active. How would I acomplish this? I believe I would need to use that gtk.CellRendererText(), but don't know how. Seems like a standard procedure done all over the web. If you have an example, please let me know.
Thanks much,
Arthur. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100924/0ef881b4/attachment.html 


More information about the Glade-users mailing list