[wx-dev] scrolling code is wrong :-)

Paul Cornett pc-wx at bullseye.com
Tue Jun 26 05:33:16 PDT 2007


Robert Roebling wrote:
> Paul Cornett wrote:
> > Robert Roebling wrote:
> > > I changed wxWindowGTK::ConnectWidget( .. ) to use
> > > g_signal_connect_after when connecting to the "scroll_event"
> > > signal and I still get the event in my test (just put a printf in
> > > window_scroll_event). You probably mean something else which I
> > > didn't understand.
> > 
> > I checked the GtkScrolledWindow code, and it does return true for
> > the "scroll_event" signal, so maybe there is something else going
> > on. Using g_signal_connect_after, do you see the "extra" scrolling
> > that would indicate GtkScrolledWindow is also handling the signal?
> 
> Yes,

Apparently "scroll_event" gets passed up the parent chain. So using
connect_after on m_wxwindow doesn't work, since if not handled it will
be passed up to m_widget later. If "scroll_event" is always connected
to m_widget, it works.

But now I realize doing it this way won't allow the user a chance to
handle wheel events.




More information about the wx-dev mailing list