[pygtk] Linking textview and combobox
Brian Rowlands (Greymouth High School)
RowlandsB at greyhigh.school.nz
Tue Jun 8 16:10:16 WST 2010
Hi Folks
Found my mental block:
divisions = []
textbuffer = cbc['divisions'].get_buffer()
text =
cbc['divisions'].get_buffer().get_text(*textbuffer.get_bounds())
divisions = text.splitlines()
<-------------------------- needed this and a minor change in the lines
above
if no_divisions != '':
#set divisions list
store = gtk.ListStore(str)
for i in divisions:
if i != '' : store.append([i])
cbc['divisionCB'].set_model(store)
cell = gtk.CellRendererText()
cbc['divisionCB'].pack_start(cell, True)
cbc['divisionCB'].add_attribute(cell, 'text', 0)
Cheers
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100608/7ad1bab1/attachment.htm
More information about the pygtk
mailing list