Scroll to child window in wx.ScrolledWindow

I have a wx.ScrolledWindow with some child windows in it.

I would like a function to scroll to a child window.

For example: scrollToChild(childWindow). This function would scroll to the child window.

This function seems very useful but I can’t find a function like this in the API. Does anyone know how this can be done?

Not sure how to do it with wx.ScrolledWindow, but if you could use wx.lib.scrolledpanel.ScrolledPanel, it has a method:

ScrollChildIntoView(child)

Che

···

On Sat, Sep 1, 2012 at 7:13 AM, Waffle mathyouk@gmail.com wrote:

I have a wx.ScrolledWindow with some child windows in it.

I would like a function to scroll to a child window.

For example: scrollToChild(childWindow). This function would scroll to the child window.

This function seems very useful but I can’t find a function like this in the API. Does anyone know how this can be done?

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

It would be nice if this would be in "Scrolled", so it would be available for ScrolledWindow and ScrolledCanvas.

Robin, you think an enhancement request for this is reasonable or is there another way of doing it with these classes?

Werner

···

On 01/09/2012 15:21, C M wrote:

Not sure how to do it with wx.ScrolledWindow, but if you could use wx.lib.scrolledpanel.ScrolledPanel, it has a method:

ScrollChildIntoView(child)

It's worth a try. The code is basically already there for the EVT_CHILD_FOCUS handler, so refactoring it into a public method would not be too difficult.

···

On 9/1/12 11:38 PM, Werner wrote:

On 01/09/2012 15:21, C M wrote:

Not sure how to do it with wx.ScrolledWindow, but if you could use
wx.lib.scrolledpanel.ScrolledPanel, it has a method:

ScrollChildIntoView(child)

It would be nice if this would be in "Scrolled", so it would be
available for ScrolledWindow and ScrolledCanvas.

Robin, you think an enhancement request for this is reasonable or is
there another way of doing it with these classes?

--
Robin Dunn
Software Craftsman

Done - Ticket 14629

Werner

···

On 03/09/2012 21:16, Robin Dunn wrote:

On 9/1/12 11:38 PM, Werner wrote:

On 01/09/2012 15:21, C M wrote:

Not sure how to do it with wx.ScrolledWindow, but if you could use
wx.lib.scrolledpanel.ScrolledPanel, it has a method:

ScrollChildIntoView(child)

It would be nice if this would be in "Scrolled", so it would be
available for ScrolledWindow and ScrolledCanvas.

Robin, you think an enhancement request for this is reasonable or is
there another way of doing it with these classes?

It's worth a try. The code is basically already there for the EVT_CHILD_FOCUS handler, so refactoring it into a public method would not be too difficult.