Scroll to selected item in wx.ListCtrl

It's possible to select an item in a wx.ListCtrl with:

listctrl.SetItemState(item, wx.LIST_STATE_SELECTED,
wx.LIST_STATE_SELECTED)

However this does not scroll the view to the selected item. Is it
possible to tell the wx.ListCtrl to scroll the view so that the
selected item is visible (as if you've selected with arrow keys on
they keyboard)?

Hi,

···

On Thu, Mar 4, 2010 at 9:29 AM, Luke McCarthy <luke.mccarthy@gmail.com> wrote:

It's possible to select an item in a wx.ListCtrl with:

listctrl.SetItemState(item, wx.LIST_STATE_SELECTED,
wx.LIST_STATE_SELECTED)

However this does not scroll the view to the selected item. Is it
possible to tell the wx.ListCtrl to scroll the view so that the
selected item is visible (as if you've selected with arrow keys on
they keyboard)?

I think you can can listctrl.EnsureVisible(item) to make sure it is
scrolled into view.

Cody

Thanks, that's exactly what I wanted. I'm not sure how I missed that
when reading the docs!

···

On Mar 4, 4:43 pm, Cody Precord <codyprec...@gmail.com> wrote:

I think you can can listctrl.EnsureVisible(item) to make sure it is
scrolled into view.

Cody