select the top-most texture in the lhs on start

This commit is contained in:
Jon Dowland 2008-02-01 20:34:19 +00:00
parent 6463348d3f
commit 361270d89a

View file

@ -38,6 +38,7 @@ class HellowWorldGTK:
def lhs_callback(self, treeview): def lhs_callback(self, treeview):
offs,col = treeview.get_cursor() offs,col = treeview.get_cursor()
print offs
# TODO: sanity check the insane subscripting here # TODO: sanity check the insane subscripting here
row = treeview.get_model()[offs[0]][0] row = treeview.get_model()[offs[0]][0]
self.set_texture(row) self.set_texture(row)
@ -113,6 +114,9 @@ class HellowWorldGTK:
column.add_attribute(cell, "text", 0) column.add_attribute(cell, "text", 0)
lhs.connect("cursor-changed", self.lhs_callback) lhs.connect("cursor-changed", self.lhs_callback)
# select the top-most item
lhs.set_cursor( (0,) , None, False)
# prepare the patch list # prepare the patch list
patch_list = self.wTree.get_widget("selected_patches") patch_list = self.wTree.get_widget("selected_patches")
treestore = gtk.TreeStore(str) treestore = gtk.TreeStore(str)
@ -150,8 +154,6 @@ class HellowWorldGTK:
bar.set_fraction(float(done) / len(self.textures)) bar.set_fraction(float(done) / len(self.textures))
bar.set_text("%d/%d" % (done, len(self.textures))) bar.set_text("%d/%d" % (done, len(self.textures)))
self.set_texture(tmp_texnames[0])
self.wTree.get_widget("window1").connect("destroy", gtk.main_quit) self.wTree.get_widget("window1").connect("destroy", gtk.main_quit)
self.wTree.get_widget("quit_menu_item").connect("activate", gtk.main_quit) self.wTree.get_widget("quit_menu_item").connect("activate", gtk.main_quit)