I wrote an example:
___________________________
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gtk
from gtk import gdk
ls = gtk.TreeStore(str)
combo = gtk.ComboBox(ls)
###
cell = gtk.CellRendererText()
combo.pack_start(cell, True)
combo.add_attribute(cell, 'text', 0)
###
row1 = ls.append(None, ['Row 1'])
row2 = ls.append(None, ['Row 2'])
row3 = ls.append(None, ['Row 3'])
###
ls.append(row2, ['Child Row 1'])
ls.append(row2, ['Child Row 2'])
ls.append(row2, ['Child Row 3'])
###
d = gtk.Dialog()
d.vbox.pack_start(combo)
d.vbox.show_all()
d.run()
__________________________

On 12/11/09, Sergey Snitsaruk <[email protected]> wrote:
> I'm adding ComboBoxEntry and a TreeStore as a model to a window.
> TreeStore contains only simple hierarchy of strings.
> Example:
> str1
> str2 --> str3
> str2 --> str4
>
> My question is: Is it possible to make parent items in drop-down list
> selectable (str2 in example)?
> --
> Kind regards,
> Sergey
> _______________________________________________
> pygtk mailing list   [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to