# Filling Wx::ListCtrl with contents

**URL:** <https://www.ruby-forum.com/t/filling-wx-listctrl-with-contents/174992>\
**Category:** Ruby\
**Created:** [September 5, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/filling-wx-listctrl-with-contents/174992 "2009-09-05T13:08:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maximilian\_BrSSS\_ut](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@Maximilian\_BrSSS\_ut](https://www.ruby-forum.com/u/Maximilian_BrSSS_ut)\
**Post date:** [September 5, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/filling-wx-listctrl-with-contents/174992/1 "2009-09-05T13:08:27Z")

</div>

Hi all,

I’ve got a question concerning ListCtrl\_virtual of wxRuby since I see no  
way filling the list with dynamic contents. I’m new to Ruby so I maybe  
have to apologise for my request.

The problem is, that I have to define the on\_get\_item\_text(item, col)  
function. There I would like to use the item and col variables to read  
data from a two-dimensional array. My very problem is, that I do not  
know how to transfer the array from another function to  
on\_get\_item\_text(item, col) or better on\_get\_item\_text(item, col,  
array). I attached a rubyscript showing what I mean.

I would be very grateful, if you could give me a solution of this  
problem â€• maybe modify my testscript.

And/Or please show me how to use the approach via ListItems because the  
samplefile  
[http://wxruby.rubyforge.org/doc/samplelistctrl.html](http://wxruby.rubyforge.org/doc/samplelistctrl.html)  
at the website  
[http://wxruby.rubyforge.org/doc/listctrl.html](http://wxruby.rubyforge.org/doc/listctrl.html)  
is not accessible. I tinkered with it but it doesn’t really work.

Thank you very much in advance for your kind help.  
Kind regards,  
der Max
