[pygtk] Problems with '&' in treeview

Gian Mario Tagliaretti gianmt at gnome.org
Thu Apr 26 19:47:34 WST 2007


2007/4/26, Volker Helm <Helm.volker a gmx.de>:

Hi,

> I've got problems with the character '&' inside of a treeview.

I just tried here and I have no problem with "&" char, do you have a
working snippet? I guess the problem is somewhere else.

Below an (ugly) example that maybe can be useful:


import gtk

w = gtk.Window()
w.connect("destroy", gtk.main_quit)

l = gtk.ListStore(str, str)

t = gtk.TreeView(l)

tv1 = gtk.TreeViewColumn("Column1")
tv2 = gtk.TreeViewColumn("Column2")

c = gtk.CellRendererText()

tv1.pack_start(c)
tv2.pack_start(c)

tv1.set_attributes(c, text=0)
tv2.set_attributes(c, text=1)

t.append_column(tv1)
t.append_column(tv2)

l.append (['Test1','This and that'])
l.append (['Test2','C & A'])

w.add(t)
w.show_all()

gtk.main()

cheers
-- 
Gian Mario Tagliaretti


More information about the pygtk mailing list