populate RHS with list of patches

This commit is contained in:
Jon Dowland 2008-01-29 23:32:03 +00:00
parent 87dc4f5e7a
commit 999fb83c92

View file

@ -101,6 +101,25 @@ class HellowWorldGTK:
column.add_attribute(cell, "text", 0)
lhs.connect("cursor-changed", self.lhs_callback)
# populate the RHS list with patch names
# yes, I learnt perl once.
patches = {}
for texture in self.textures.values():
for patch in texture.patches:
patches[patch.name] = 1
patches = patches.keys()
rhs = self.wTree.get_widget("all_patch_tree")
treestore = gtk.TreeStore(str)
patches.sort()
for name in patches:
treestore.append(None, [ name ])
column = gtk.TreeViewColumn('Patch name')
rhs.set_model(treestore)
rhs.append_column(column)
cell = gtk.CellRendererText()
column.pack_start(cell, False)
column.add_attribute(cell, "text", 0)
# set the progress bar up
# by default we've "done" all the 1-patch textures
bar = self.wTree.get_widget("progressbar1")