Scrolling programmatically

Hello,

About a week ago I asked a question regarding the possibility to scroll a
wxHtmlWindow programmatically after reloading a page to the same position
as before the reloading. Robin Dunn replied with a possible solution which
however did not work (pasted at the bottom of this message).

Does this mean it is impossible? If so, should I report it as a bug?

···

--
Yours,

Andrei

=====
Mail address in header catches spam. Real contact info (decode with rot13):
cebwrpg5@bcrenznvy.pbz. Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V
ernq gur yvfg, fb gurer'f ab arrq gb PP.

Try something like this:

  ppux, ppuy = self.GetScrollPixelsPerUnit()
  psx = self.GetScrollPageSize(wxHORIZONTAL)
  psy = self.GetScrollPageSize(wxVERTICAL)
  vsx, vsy = self.GetViewStart()

  # Do whatever

  self.SetScrollbars(ppux, ppuy, psx, psy, vsx, vsy)

Andrei wrote:

Hello,

About a week ago I asked a question regarding the possibility to scroll a
wxHtmlWindow programmatically after reloading a page to the same position
as before the reloading. Robin Dunn replied with a possible solution which
however did not work (pasted at the bottom of this message).

Did you also try delaying the the call to SetScrollbars by using wxCallAfter or a timer?

Does this mean it is impossible? If so, should I report it as a bug?

Not necessarily. It just means that what I thought would work doesn't work, not that it should work. Since Vaclav (wxHtml author) is also on this list I was hoping that he might know, but asking about it on wx-users wouldn't hurt either.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Did you also try delaying the the call to SetScrollbars by using
wxCallAfter or a timer?

I did with wxCallAfter. Doesn't change anything.

    def OnLinkClicked(self, linkinfo):
        ppux, ppuy = self.GetScrollPixelsPerUnit()
        psx = self.GetScrollPageSize(wxHORIZONTAL)
        psy = self.GetScrollPageSize(wxVERTICAL)
        vsx, vsy = self.GetViewStart()
        openbranch(self.tree, int(linkinfo.GetHref()))
        self.SetPage(htmltree(self.tree))
        wxCallAfter(self.SetScrollbars, ppux, ppuy, psx, psy, vsx, vsy)

Not necessarily. It just means that what I thought would work doesn't
work, not that it should work. Since Vaclav (wxHtml author) is also on
this list I was hoping that he might know, but asking about it on
wx-users wouldn't hurt either.

Thanks, I'll try my luck there too if this doesn't work out.

···

Robin Dunn wrote on Mon, 03 Nov 2003 16:30:46 -0800: > Andrei wrote:

--
Yours,

Andrei

=====
Mail address in header catches spam. Real contact info (decode with rot13):
cebwrpg5@bcrenznvy.pbz. Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V
ernq gur yvfg, fb gurer'f ab arrq gb PP.