Hi Eric,

understanding is, of course, a good idea too ;-)

The $idx is the index of the new inserted line. WxPerl need this to identify 
the line in which to add the other items. 

InsertStringItem() will always create a new line in the ListCtrl (or ListView), 
therefore you have to use SetItem() to insert the other items.

I don't know if there is a way to insert all items of a line in one step. 

Regards Daniel




----- Ursprüngliche Mail ----
Von: Erik Colson <[EMAIL PROTECTED]>
An: [email protected]
Gesendet: Mittwoch, den 9. Juli 2008, 14:55:59 Uhr
Betreff: Re: AW: listctrl

Daniel wrote:
> Hi,
>
> I suggest to use wx::ListView
> It's nearly the same as wx::ListCtrl, but you can easyer seach selected items.
>
> Here's a sample, copy, paste and run:
>  
<snip>
>         my $idx = $myListView -> InsertStringItem( $row, $items[0]); #insert 
> the first item at the first line and row
>
>         for $row (1 .. $#items) {
>            $myListView -> SetItem( $idx, $row, $items[$row] ); #insert the 
> other items
>         }
>  
Hello Daniel,

Thanks for your answer.
I'd like to do more than copy, paste and run ;)
understanding the thing would be great!

So why the hell do I need to insert the first element with 
InsertStringItem and then add the others with SetItem ? And why do I 
need that $idx ?

Thanks again for your help!

-- 
Erik Colson

http://www.ecocode.net


      __________________________________________________________
Unglücklich mit Ihrer Mail-Adresse?

Millionen neuer Mail-Adressen - jetzt bei Yahoo!

http://de.docs.yahoo.com/mail/wunschmailadresse/index.html

Reply via email to