Pier wrote:
> Hi again,
> Ricardo Caesar Lenzi wrote:
>
> >
> > Try this:
> >
> > def on_clist_button_press_event(clist,mousebutton,data):
> > if mousebutton.type==5:
> > print "Double-click!"
> >
> > clist.connect("button_press_event",on_clist_button_press_event)
> >
> > - Ricardo
>
> this does not work because the mousebutton in the previous example returns
> me a gdkEvent object and
> I don't know its structure. Probably it contains the information I need
> but I can't get it
> Can you give me some information about the structure of a GdkEvent object ?
> (a link to some docs is also appreciate)
I don't remember where I saw that documentation, but one of the
attributes of gdkEvent is type and, in my pyGtk (0.6.6), gdkEvent.type
returns 4 when clist get a single click and 5 when get a double click.
Here is a full python program that show this:
--------------------------------------------------
from gtk import *
w=GtkWindow()
w.set_default_size(100,100)
clist=GtkCList()
clist.append(["item 1"])
clist.append(["item 2"])
clist.append(["item 3"])
clist.show()
w.add(clist)
w.show()
w.connect("destroy",mainquit)
def on_clist_button_press_event(clist,mousebutton,*args):
print mousebutton.type
clist.connect("button_press_event",on_clist_button_press_event)
mainloop()
---------------------------------------------------
You can look at www.gtk.org, in GDK tutorials... this can also help you.
- Ricardo
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk