Phil Puccio wrote:> Hi,
>
> In a thread back in March, Alex Fenton provided a fix in one line of
> ListCtrl.get_selections:
>
> >class Wx::ListCtrl
> > def get_selections
> > selections = []
> > item = get_next_item(-1, Wx::LIST_NEXT_ALL,
Wx::LIST_STATE_SELECTED)
> > while item >= 0
> > selections << item
> > item = get_next_item(item, Wx::LIST_NEXT_BELOW,
Wx::LIST_STATE_SELECTED)
> > end
> > selections
> > end
> >end
> >The only change is Wx::LIST_NEXT_ALL was previously LIST_NEXT_BELOW.
> That fix got me past my initial problem, too, but then I found that if I
sent get_selections to a ListCtrl with only one row or with no rows
(I''m using report mode), the code would go into a loop and hang my CPU.
After changing the second reference of Wx::LIST_NEXT_BELOW to Wx::LIST_NEXT_ALL,
everything worked fine for me.
> Alex, you might want to consider this additional change.
Thanks very much Phil, I''ve committed this change to SVN
alex