maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   HildonPannableArea + Eventbox(button-press-event) = click not pan (https://talk.maemo.org/showthread.php?t=33079)

code177 2009-10-19 00:23

HildonPannableArea + Eventbox(button-press-event) = click not pan
 
I have a grid of thumbnail images in a hildonpannablearea. In order to make the images clickable, I've put them in eventBox()es.

However, it turns out - at least in the SDK - this disables the panning functionality of the pannablearea, because as soon as you click to pan, it activates the event.

If you're confused as to what I mean, think of the image gallery in the n900 promo material.

So. Is this a bug or am I doing something horribly wrong?

Anyone know of a workaround? I need to make these images clickable...

Thanks everyone!

yerga 2009-10-19 09:38

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
A quick suggestion: GtkIconView + HildonPannableArea (I don't know if it will work though).

code177 2009-10-19 16:21

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
Thanks Yerga! I will try this and post a conclusion..

code177 2009-10-20 04:16

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
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)


code177 2009-10-27 18:58

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
Actually, I was wrong about this. It doesn't work. Although it now allows you to pan, it still activated whatever was clicked when panning was initiated when you let go.

nicolai 2009-10-28 08:55

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
I don't know if this helps, the api for HildonPannableArea describes a property velocity-fast-factor as
Minimum velocity that is considered 'fast': children widgets won't receive button presses. Expressed as a fraction of the maximum velocity.

nicolai

conny 2009-10-28 09:39

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
You could use GtkButtons with images inside a HildonPannableArea. That's probably not the style you're looking for, but it would get you started.

Also try asking this question on the developer mailing list. Some of the Hildon developers are there and usually provide good advice on problems like that.

code177 2009-11-10 00:03

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
Finally taken this to the maemo-developers list. Hopefully somebody there will have the answer. If so I'll post it.

code177 2009-11-13 02:35

Re: HildonPannableArea + Eventbox(button-press-event) = click not pan
 
The solution to this, for anyone searching, is here: http://talk.maemo.org/showthread.php?t=34369, thanks to zaheerm!


All times are GMT. The time now is 12:29.

vBulletin® Version 3.8.8