[pygtk] gtk.ListStore columns in a gtk.ComboBox
Isaac Alston
genelisp at googlemail.com
Mon Jun 23 00:09:49 WST 2008
Hi,
I am making a search function where users can select two fields which
they'd like to search on in a database. I'm having trouble displaying
a single column from a gtk.ListStore with multiple columns in a
gtk.ComboBox correctly. I have two columns in my ListStore: 'id' and
'field'. 'field' holds text like 'Artist' and 'Name'. I have an id so
I can compare their selection easily - I do not want to compare names
like 'Artist' and 'Name' in the code, especially as they will be
i18ned too. I've tried getting the ComboBox to display only the second
column with add_attribute, but it seems to add the 'id' column by
default and displays both the id and field side-by-side. How do I stop
this so that it only shows the 'field' column?
Here's my code: http://dpaste.com/hold/58180/ and here's a screenshot
of the window - note the ComboBoxes in the search area -
http://tinyurl.com/3sbu4w .
Any suggestions and help are appreciated.
Thanks,
--
Isaac
More information about the pygtk
mailing list