# Edit label in virtual listctrl

**URL:** <https://www.ruby-forum.com/t/edit-label-in-virtual-listctrl/118539>\
**Category:** wxRuby\
**Created:** [October 28, 2007, 12:00pm UTC](https://www.ruby-forum.com/t/edit-label-in-virtual-listctrl/118539 "2007-10-28T12:00:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnus\_EngstrSSSSm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@Magnus\_EngstrSSSSm](https://www.ruby-forum.com/u/Magnus_EngstrSSSSm)\
**Post date:** [October 28, 2007, 12:00pm UTC](https://www.ruby-forum.com/t/edit-label-in-virtual-listctrl/118539/1 "2007-10-28T12:00:28Z")

</div>

Hi,

I am testing a virtual listctrl, and have run into some problems with  
changing the labels in it.

The listctrl shows a bunch of rows and columns, and it gets activate  
events whenever I doubleclick on a cell. Works like a charm.

My problem comes when I call the edit\_label method, specifically that I  
think that I don’t quite understand the argument passed to it (item as  
integer). This would seem to be the row, and when passed a row number,  
the edit control shows up just fine, for the first column. How would I  
go about to specifiy a label in another column?

Thanks,  
Magnus EngstrÃ¶m

---

<div class="post-metadata">

**Author:** ![Magnus\_EngstrSSSSm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@Magnus\_EngstrSSSSm](https://www.ruby-forum.com/u/Magnus_EngstrSSSSm)\
**Post date:** [October 28, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/edit-label-in-virtual-listctrl/118539/2 "2007-10-28T15:15:24Z")

</div>

Hi Magnus

Magnus EngstrÃ¶m wrote:

> My problem comes when I call the edit\_label method, specifically that I  
> think that I don’t quite understand the argument passed to it (item as  
> integer). This would seem to be the row, and when passed a row number,  
> the edit control shows up just fine, for the first column. How would I  
> go about to specifiy a label in another column?

I was a bit surprised to find that editing a second column label is not  
supported in wxWidgets, because the Windows native control doesn’t allow  
that:  
[http://lists.wxwidgets.org/archive/wx-users/msg35847.html](http://lists.wxwidgets.org/archive/wx-users/msg35847.html)

You could try using a Wx::Grid, or perhaps capturing evt\_list\_dclick,  
and draw a TextCtrl yourself on top of the ListItem.

hth  
alex

---

<div class="post-metadata">

**Author:** ![Magnus\_EngstrSSSSm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@Magnus\_EngstrSSSSm](https://www.ruby-forum.com/u/Magnus_EngstrSSSSm)\
**Post date:** [October 28, 2007, 3:28pm UTC](https://www.ruby-forum.com/t/edit-label-in-virtual-listctrl/118539/3 "2007-10-28T15:28:16Z")

</div>

On Sun, 2007-10-28 at 15:04 +0000, Alex F. wrote:

> supported in wxWidgets, because the Windows native control doesn’t allow  
> that:  
> [http://lists.wxwidgets.org/archive/wx-users/msg35847.html](http://lists.wxwidgets.org/archive/wx-users/msg35847.html)
> 
> You could try using a Wx::Grid, or perhaps capturing evt\_list\_dclick,  
> and draw a TextCtrl yourself on top of the ListItem.
> 
> hth  
> alex

Ah, Wx::Grid looks nice. Thanks.

/Magnus
