Re: Routing scroll events in a Gtk.Overlay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



GtkWidget::scroll-event, though, is a RUN_LAST signal; it means that
the handlers connected using g_signal_connect() will run before the
class handler. on top of that, neither GtkWidget nor GtkEventBox have
a default class handler, so connecting to the signal is identical to
getting your callback called first.

as for how gtkmm implements a 'before' flag: that's pretty much
impossible if the signal is defined as RUN_FIRST when installed on the
type; RUN_FIRST means that the default class handler is always called
before any signal connected using g_signal_connect(). to avoid that
you'd have to subclass the original class, override the signal
handler, and from the override you would have to call your code before
chaining up.

ciao,
 Emmanuele.


On 5 June 2014 21:14, Paul Davis <paul@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
>
> On Thu, Jun 5, 2014 at 4:12 PM, Robert Schroll <rschroll@xxxxxxxxx> wrote:
>>
>>
>> def eb_scroll(widget, event):
>>    print "Event Box scroll event"
>>    return True
>> eb.connect('scroll-event', eb_scroll)
>
>
> this connects after the default handler, not before it.
>
> i don't know pygtk all that well; in gtkmm (the C++ binding) there is an
> optional "before" boolean argument to the connect call to get the handler
> connected BEFORE the default handler.
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list@xxxxxxxxx
> https://mail.gnome.org/mailman/listinfo/gtk-list
>



-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux