[wx-dev] scrolling code is wrong :-)
Paul Cornett
pc-wx at bullseye.com
Mon Jun 25 20:08:21 PDT 2007
Robert Roebling wrote:
>
> > > It strikes
> > > me as a very clean approach to disable events, then set
> > > the scrollbar (or value or whatever) and then reenable
> > > event emission/notification again.
> >
> > I can see that if SetScrollPos is called recursively
> > (which does happen)
>
> wxWindow::SetScrollPos doesn't emit any event and calls
> no other wxWidgets method, it cannot cause a refresh,
> neither a resize. How exactly will it be called
> recursively? Either way, feel free to change it back,
> the main thing is that the code works.
Yes, you're right, it can't be recursive, I was thinking nonsense.
After looking at it some more, I agree that blocking the signal is
better, as it allowed getting rid of m_blockValueChanged, whose purpose
was not so obvious. I think it would be slightly better to block the
signal (using g_signal_handlers_block_by_func), rather than
disconnecting it, though.
More information about the wx-dev
mailing list