self.statusbar.push(0, text) self.set_preview() self.sprite = self.spdb.get_sprite_from_number(model[row][0]) self.queue_draw() if __name__ == "__main__": if len(sys.argv) > 1: filename = sys.argv[1] else: #filename = "../tilemap/flash.inc" filename = "sprite.inc" prev = interface() prev.spdb = spritedb() #prev.spdb.read_from_file(filename) #prev.sprite = prev.spdb.db[0] #prev.m = map(128,128) #print prev.m #prev.m.read_from_file("map.inc") prev.set_position(gtk.WIN_POS_CENTER) # prev.set_size_request(1200, 800) prev.set_size_request(1200, 600) prev.set_resizable(False) prev.connect("destroy", prev.quit, 'Quit') prev.sprite_list_vbox = prev.create_list_store(prev.spdb)
self.statusbar.push(0, text) self.set_preview() self.sprite = self.spdb.get_sprite_from_number(model[row][0]) self.queue_draw() if __name__ == "__main__": if len(sys.argv) > 1: filename = sys.argv[1] else: #filename = "../tilemap/flash.inc" filename = "sprite.inc" prev = interface() prev.spdb = spritedb() #prev.spdb.read_from_file(filename) #prev.sprite = prev.spdb.db[0] #prev.m = map(128,128) #print prev.m #prev.m.read_from_file("map.inc") prev.set_position(gtk.WIN_POS_CENTER) # prev.set_size_request(1200, 800) prev.set_size_request(1200, 600) prev.set_resizable(False) prev.connect("destroy", prev.quit, 'Quit')
for s in spritedb.db: store.append([s.number, s.name]) return store def create_columns(self, treeView): rendererText = gtk.CellRendererText() column = gtk.TreeViewColumn("Name", rendererText, text=0) column.set_sort_column_id(0) treeView.append_column(column) rendererText = gtk.CellRendererText() column = gtk.TreeViewColumn("Number", rendererText, text=1) column.set_sort_column_id(1) treeView.append_column(column) def on_activated(self, widget, row, col): model = widget.get_model() text = model[row][0] + ", " + model[row][1] + ", " + model[row][2] self.statusbar.push(0, text) spdb = spritedb() spdb.read_from_file("gut.inc") print spdb sprite_store(spdb) gtk.main()