GTK3 fixes book report

svn: r20161
This commit is contained in:
Gary Burton 2012-07-31 14:12:55 +00:00
parent 5f92d658dc
commit 3158247c90
2 changed files with 4 additions and 3 deletions

View File

@ -322,7 +322,7 @@ class ListModel(object):
""" """
store, node = self.selection.get_selected() store, node = self.selection.get_selected()
if node: if node:
rows = store.get_path(node) rows = store.get_path(node).get_indices()
return rows[0] return rows[0]
else: else:
return -1 return -1
@ -413,8 +413,8 @@ class ListModel(object):
for obj in data: for obj in data:
self.model.set_value(node, col, obj) self.model.set_value(node, col, obj)
col += 1 col += 1
self.model.set_value(node, col, info)
if info: if info:
self.model.set_value(node, col, info)
self.idmap[str(info)] = node self.idmap[str(info)] = node
if select: if select:
self.selection.select_iter(node) self.selection.select_iter(node)

View File

@ -41,7 +41,8 @@ class StyleComboBox(Gtk.ComboBox):
""" """
Initialize the combobox, building the display column. Initialize the combobox, building the display column.
""" """
GObject.GObject.__init__(self,model) GObject.GObject.__init__(self)
self.set_model(model)
cell = Gtk.CellRendererText() cell = Gtk.CellRendererText()
self.pack_start(cell,True) self.pack_start(cell,True)
self.add_attribute(cell,'text',0) self.add_attribute(cell,'text',0)