[maemo-developers] Problems Panning/Clicking with GtkIconView

From: Jonathan Blake code177 at gmail.com
Date: Fri Nov 13 22:30:05 EET 2009
The solution to this, thanks to zaheerm on talk.maemo.org -

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


On Mon, Nov 9, 2009 at 4:04 PM, Jonathan Blake <code177 at gmail.com> wrote:
> Hi everyone,
> I am having a hell of a time trying to get an GtkIconView working correctly
> with the pannable area widget. Using hildon.GtkIconView I am able to pan by
> using the scrollwheel on my mouse, but if i click anywhere to start panning,
> it immediately activates whatever was clicked on. gtk.IconView does pretty
> much exactly the same thing. Removing the connect function obviously allows
> you to pan freely.
> Code is as follows (I've left in various settings etc for completeness'
> sake):
> ------------
> pan_area = hildon.PannableArea()
> model = gtk.ListStore(str, gtk.gdk.Pixbuf)
> for item in xmlf:
>     thumbnail_data = gtk.gdk.pixbuf_new_from_file(
> cache_path_thumbs + item["filename"])
>     model.append([str(item['name']), thumbnail_data])
> grid = hildon.GtkIconView(gtk.HILDON_UI_MODE_NORMAL, model)
> grid.set_selection_mode(gtk.SELECTION_SINGLE)
> grid.set_pixbuf_column(1)
> grid.set_columns(4)
> grid.set_item_width(190)
> grid.set_spacing(thumbnail_spacing)
> grid.connect('selection-changed', self.thumbnailSelect, model, window)
> pan_area.add_with_viewport(grid)
> ------------
> Points of note: I'm using the Vmware SDK. I know that has a few bugs so
> maybe this is one of them. As mentioned, the scrollwheel does pan the area,
> so pannable area is working as intended.
> Does anyone have any ideas? this is a pretty critical issue and I don't know
> of anyone else who's managed to get this working.
> What am I doing wrong?
> Thanks!
More information about the maemo-developers mailing list