Forum: wxRuby ListCtrl loading data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
89f9acdcbc663e41e45ce590cd746d6e?d=identicon&s=25 Fabio Petrucci (Guest)
on 2008-10-18 06:33
(Received via mailing list)
Attachment: listctrl_test.rb (3 KB)
Hi all,

I'm using a ListCtrl on LC_REPORT mode.

using set_item(index, col,  'value') the list does't get populated.

Is it a bug? which is the method to call?

i'm using ruby 1.8.6 wxruby 1.9.8 mswin32 on winXP

attached is an example.

thank you.

bio.
3396e4a3df8a840faec520af8555a400?d=identicon&s=25 Mario Steele (Guest)
on 2008-10-18 08:04
(Received via mailing list)
The problem is, set_item() need to have a valid item in which to set
information on.  So change the following code to represent this:

        insert_item(0,  'Item 0 col 0')
        set_item(0, 1,  'Item 0 col 1')
        insert_item(1,  'Item 1 col 0')
        set_item(1, 1,  'Item 1 col 1')

You will get better results this way, then the other way.

On Fri, Oct 17, 2008 at 11:17 AM, Fabio Petrucci
89f9acdcbc663e41e45ce590cd746d6e?d=identicon&s=25 Fabio Petrucci (Guest)
on 2008-10-20 15:26
(Received via mailing list)
Thank you Mario, now is ok :)

bio.
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2008-10-20 16:34
(Received via mailing list)
Hi

Firstly, sorry haven't been following the list for the last week or so.
Have been away with work and pretty busy and haven't had time to follow
up everything.

Fabio Petrucci wrote:
>             insert_item(0,  'Item 0 col 0')
>             set_item(0, 1,  'Item 0 col 1')
>             insert_item(1,  'Item 1 col 0')
>             set_item(1, 1,  'Item 1 col 1')
>
Seeing this laid out plainly makes me think we must be able to come up
with a syntax improvement. I was thinking of something that accepts an
array for each row and just does the right thing....

append [ "item 0 col 0", "item 0 col 1"],
            [ "item 1 col 0", "item 1 col 1"]
 ...

alex
This topic is locked and can not be replied to.