[wxPython] Listctrl scrolling selection

I had a question some time ago which is still unresolved.

I would like to have the ListCtrl scroll down to a selected value. In some
previous releases this was easily accomplished with a SetItemState(no,
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) approach. That hasn't worked for
quite a while.

In the wxListCtrl demo, if the value 5 is changed to 25 in line 93 ie.
self.list.SetItemState(25, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) the
problem is illustrated. The value is selected but no effect on the scroll
value.

What is the suggested approach if this is not workable from now on?

Lorne White

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Lorne wrote:

I had a question some time ago which is still unresolved.

I would like to have the ListCtrl scroll down to a selected value. In some
previous releases this was easily accomplished with a SetItemState(no,
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) approach. That hasn't worked for
quite a while.

In the wxListCtrl demo, if the value 5 is changed to 25 in line 93 ie.
self.list.SetItemState(25, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) the
problem is illustrated. The value is selected but no effect on the scroll
value.

What is the suggested approach if this is not workable from now on?

Lorne White

I haven't done this before but EnsureVisible() sounds like what you
want.

···

--
Riaan >>> a='a=%s;a%%`a`';a%`a`
___________________________________________________
Boa Constructor - RAD GUI building IDE for wxPython
     http://boa-constructor.sourceforge.net
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Hello Lorne,

Thursday, September 28, 2000, 6:24:02 AM, you wrote:

I had a question some time ago which is still unresolved.

I would like to have the ListCtrl scroll down to a selected value. In some
previous releases this was easily accomplished with a SetItemState(no,
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) approach. That hasn't worked for
quite a while.

In the wxListCtrl demo, if the value 5 is changed to 25 in line 93 ie.
self.list.SetItemState(25, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) the
problem is illustrated. The value is selected but no effect on the scroll
value.

What is the suggested approach if this is not workable from now on?

I use this:

        self.EnsureVisible( i )
        self.SetItemState( i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED )

···

--
HTH,
Niki

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users