code177
11-12-2009, 07:35 PM
Hi all
So I've been busy trying to figure out this iconview issue (http://talk.maemo.org/showthread.php?t=33079) without much luck, it was mentioned on maemo-developers that it may be a bug in the SDK, although it's not supposed to be present in prefinal.
Sadly, it's not working, so we need to establish whether this is an SDK bug, something I'm doing discreetly wrong, or perhaps an issue with pymaemo widgets (or a handful of other wonderful things).
That in mind, it would be great if someone would run this script excerpt (python) on an actual n900 device and confirm whether or not it works correctly!
It needs some minor tweaking (needs to be put into a function, and have a small image to use as a pixbuf) but should run fine..
pan_area = hildon.PannableArea()
model = gtk.ListStore(str, gtk.gdk.Pixbuf)
for i in range(0,40):
thumbnail_data = gtk.gdk.pixbuf_new_from_file(**ADD FILENAME HERE**)
model.append([str(item['name']), thumbnail_data])
del thumbnail_data
grid = hildon.GtkIconView(gtk.HILDON_UI_MODE_NORMAL) grid.set_selection_mode(gtk.SELECTION_SINGLE)
grid.set_pixbuf_column(3)
grid.set_columns(4)
grid.set_item_width(190)
grid.set_spacing(5)
grid.connect('selection-changed', self.thumbnailSelectThumbs, model)
grid.set_model(model)
grid.queue_draw()
pan_area.add_with_viewport(grid)
def thumbnailSelectThumbs(self, icon_view, model):
print 'selected'
Many thanks and appreciation to whoever successfully tests this!
So I've been busy trying to figure out this iconview issue (http://talk.maemo.org/showthread.php?t=33079) without much luck, it was mentioned on maemo-developers that it may be a bug in the SDK, although it's not supposed to be present in prefinal.
Sadly, it's not working, so we need to establish whether this is an SDK bug, something I'm doing discreetly wrong, or perhaps an issue with pymaemo widgets (or a handful of other wonderful things).
That in mind, it would be great if someone would run this script excerpt (python) on an actual n900 device and confirm whether or not it works correctly!
It needs some minor tweaking (needs to be put into a function, and have a small image to use as a pixbuf) but should run fine..
pan_area = hildon.PannableArea()
model = gtk.ListStore(str, gtk.gdk.Pixbuf)
for i in range(0,40):
thumbnail_data = gtk.gdk.pixbuf_new_from_file(**ADD FILENAME HERE**)
model.append([str(item['name']), thumbnail_data])
del thumbnail_data
grid = hildon.GtkIconView(gtk.HILDON_UI_MODE_NORMAL) grid.set_selection_mode(gtk.SELECTION_SINGLE)
grid.set_pixbuf_column(3)
grid.set_columns(4)
grid.set_item_width(190)
grid.set_spacing(5)
grid.connect('selection-changed', self.thumbnailSelectThumbs, model)
grid.set_model(model)
grid.queue_draw()
pan_area.add_with_viewport(grid)
def thumbnailSelectThumbs(self, icon_view, model):
print 'selected'
Many thanks and appreciation to whoever successfully tests this!