View Single Post
Guest | Posts: n/a | Thanked: 0 times | Joined on
#4
GTK IconView works!

Here's the basic concept incase anyone searches for it:
Code:
model = gtk.ListStore(str, gtk.gdk.Pixbuf) # str is going to be our id field
model.append([item['id'], pixbuf_data]) # add to list..
gallery = gtk.IconView(model) # make it into an icon view
gallery.connect('selection-changed', self.selectThumb, model) # add signal thingy

def selectThumb(self, icon_view, model=None): 
selected = icon_view.get_selected_items()
i = selected[0][0]
self.awesomeFunction(model[i][0]) # passes id to our function (opens new window)