I'm just starting out with pygtk, and I'm having some trouble putting rows into a table. Despite the fact that I am adding rows (and I can tell that rows are being added by the selection bar in the screenshot), The text in them doesn't appear. I've changed the default cell renderer to gtk.CellRendererText and have been able to set the background color, but the text of the elements in the row simply doesn't show up.
I must be doing something very simple, but I can't figure out what's so
different from the various examples of pygtk tables that I've looked at
and run.
I am using Ubuntu Hoary's packages of python (2.4.1), gtk (2.6.4) and
pygtk (2.6.1).
Here's my python source:
===============================================================
#!/usr/bin/env python
import gtk
import gtk.glade
import gobject
APPNAME="Labelator"
APPVERSION="0.1"
class WidgetsWrapper:
def __init__(self):
"""
"""
self.widgets = gtk.glade.XML('labelator.glade',
'Labelator')
dic = {'gtk_main_quit': gtk.main_quit,
'on_quit1_activate': self.on_quit1_activate}
self.widgets.signal_autoconnect(dic)
table = self.widgets.get_widget('MainTable')
liststore =
gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_STRING)
for column in ("Column 1", "Column 2"):
table_column = gtk.TreeViewColumn(column)
table.append_column(table_column)
for row in (("Column 1/Row 1", "Column 2/Row 1"),
("Column 1/Row 2", "Column 2/Row 2")):
liststore.append(row)
table.set_model(liststore)
def on_quit1_activate(self, event):
gtk.main_quit()
if __name__ == "__main__":
widgets = WidgetsWrapper()
gtk.main()
===============================================================
The glade file and (small) screenshot of my run are attached.
thanks,
mike
--
Michael R Head <[EMAIL PROTECTED]>
burner | suppressingfire | firestorm | phoenix | firefighter
Screenshot-Labelator.png
Description: PNG image
labelator.glade
Description: application/glade
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
