# LC\_VIRTUAL with Wx::ListCtrl

**URL:** <https://www.ruby-forum.com/t/lc-virtual-with-wx-listctrl/151341>\
**Category:** wxRuby\
**Created:** [October 20, 2008, 3:01pm UTC](https://www.ruby-forum.com/t/lc-virtual-with-wx-listctrl/151341 "2008-10-20T15:01:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 20, 2008, 3:01pm UTC](https://www.ruby-forum.com/t/lc-virtual-with-wx-listctrl/151341/1 "2008-10-20T15:01:18Z")

</div>

Wx::ListCtrl#set\_item\_count appears to be broken. If I pass it  
anything but a Fixnum (is\_a Integer), it crashes and says it needs a  
“long” (which Fixnum should appease), but if I pass it a Fixnum it  
crashes with “cannot convert nil into String.”

Latest WxRuby. Windows Vista.

This makes using LC\_VIRTUAL impossible.

– Eric W. // xmpp:removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![ericw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/97f17d/32.png) [@ericw](https://www.ruby-forum.com/u/ericw)\
**Post date:** [October 20, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/lc-virtual-with-wx-listctrl/151341/2 "2008-10-20T15:33:39Z")

</div>

On Oct 20, 2008, at 8:59 AM, Eric W. wrote:

> Wx::ListCtrl#set\_item\_count appears to be broken. If I pass it  
> anything but a Fixnum (is\_a Integer), it crashes and says it needs a  
> “long” (which Fixnum should appease), but if I pass it a Fixnum it  
> crashes with “cannot convert nil into String.”

Never mind. My on\_get\_item\_text method wasn’t returning a string, and  
this was the useless error that Ruby gives me thanks to Ruby’s useless  
threads.
