PDA

View Full Version : Possible SDK Bug in Iconview, could someone test this on an N900?


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!

zaheerm
11-12-2009, 07:39 PM
I had exactly this problem in zoutube today. i fixed it however. So:

1st change your event connection to be "item-activated" not "selection-changed"
2nd no need to set the selection mode
3rd don't add the grid with add_with_viewport, instead use add

code177
11-12-2009, 08:08 PM
I had exactly this problem in zoutube today. i fixed it however. So:

1st change your event connection to be "item-activated" not "selection-changed"
2nd no need to set the selection mode
3rd don't add the grid with add_with_viewport, instead use add


Wow good to know. Thank you so much! I will try this out when I get home!

code177
11-12-2009, 09:34 PM
This worked! THANK YOU! I've been fighting with this for like a month!