On Mon, 2004-03-29 at 12:45, Toon Verstraelen wrote:
> Johan Dahlin wrote:
> > Of course, it was True and not False, so the following should do it:
> >
> > def button_press_cb(tree, event):
> > if event.button != 1:
> > return True
> > tv.connect('button-press-event', button_press_cb)
>
> Works great! Thank you very much! Is the return value of a event handler
> something one can always use to 'cancel' that event?
Yes, it should be possible for all events (eg, onces received from X),
and you can do it for a few others. Unfortunately the PyGtk reference
manual does not show if it's okay to return a value or not, so you'd
have to look in the Gtk+ Reference Manual;
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkWidget-button-press-event
And look at the return value of the signal, if it's boolean, then you
can return True to block the event.
--
Johan Dahlin <[EMAIL PROTECTED]>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/