On 29-04-11 21:06, Shrihari Sankaran wrote:
Hello,

I'm fairly new to PyGTK. Just getting started. I've worked with wxPython in the past. I'm trying to create a grid of clickable images. Like this one: http://getmoviemonkey.com/img/screen1.jpg

I managed to get the image grid using IconView. But, i need to do a little more:
1) I don't want the blue high-light
Looking at the reference manual [1], this could be possible with style property "selection-box-color".

2) I want the cursor to be "pointer" whenever the mouse if over an image
I don't know about this one. But you could connect to the motion-notify-event [2] of the iconview, there get the (x,y) coordinates of the mousepointer. Check if there is an image at that position with iconview.get_item_at_pos(x, y) [3], and if so, change the cursor with gtk.gdk.Cursor [4]. See the FAQ [5] for an example how.

3) I want to catch and respond to single clicks on images. I guess this can be achieved by capturing the "selection-changed" event.
That seems like the best choice to me too.

Cheers,
Timo

[1] http://developer.gnome.org/pygtk/stable/class-gtkiconview.html
[2] http://developer.gnome.org/pygtk/stable/class-gtkwidget.html#signal-gtkwidget--motion-notify-event [3] http://developer.gnome.org/pygtk/stable/class-gtkiconview.html#method-gtkiconview--get-item-at-pos
[4] http://developer.gnome.org/pygtk/stable/class-gdkcursor.html
[5] http://faq.pygtk.org/index.py?req=show&file=faq05.006.htp


Thanks,
Shrihari


_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to