[Gambas-user] listview questions

Benoit Minisini gambas at ...1...
Wed May 11 11:12:37 CEST 2005

On Sunday 08 May 2005 12:19, Alain Van der Eycken wrote:
> Hi All,
> Being reasonably new with Gambas, i find myself struggling with the
> listview control in multiselect mode
> Can someone please (pretty please with a cherry on top) show me the gambas
> way of how to:
> loop through every item in the list, and delete it from the list if the
> listview.item.selected property is set ?
> I've constructed this for-next monstrosity which does kinda-sorta what i
> want, but it's ugly and error-prone and just doesn't feel right. How do you
> do it the gambas way ?
> and:
> How do i move the view to another item in the list ?
> When i load the list, it comes up with the first item in the list.
> According to the docs, there is a method 'MoveTo(key)' that should change
> the view to the item in question. However, i must be missing something here
> as well. Suppose i load a list with 200 items. When the list comes up, it
> shows item1, item2,etc --which is of course fine and dandy-- however,I want
> the list to show item150.
> When i do a listview.moveto(key of item150) the view doesn't change to
> display item150, but keeps on displaying item1.
> So what is it that i am missing/not doing here ??
> Kind Regards,
> Alain

The Move*() method moves the *internal* cursor of the ListView. This cursor is 
intended to let you loop throug every ListView item. The ListView.Item 
returns the current item pointed by the internal cursor.

To change the visible selected item, use the Selected property of the item. 
ListView.Current returns the current selected item.

Are things clearer now ?

Benoit Minisini
mailto:gambas at ...1...

More information about the User mailing list