# Images in wxListCtrl

**URL:** <https://www.ruby-forum.com/t/images-in-wxlistctrl/177984>\
**Category:** wxRuby\
**Created:** [October 27, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/images-in-wxlistctrl/177984 "2009-10-27T15:25:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [October 27, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/images-in-wxlistctrl/177984/1 "2009-10-27T15:25:16Z")

</div>

Hi again,

I’m still struggeling with wxRuby/wxWidgets ListCtrl. Now I would like  
to add images to some specific cells/columns.

First problem:  
API docs are unclear. There is a section about  
“ListCtrl#set\_item\_column\_image” but it seems that this method does  
not exist. Actually the text in this section references to  
“ListCtrl#set\_item\_image” but it’s not clear to me how I can add for  
example, an image to cells in the third column.

Second problem:  
Calling "ListCtrl#set\_item\_image(item, image) does not work for me. I  
always have to use three paremeters when calling set\_item\_image.

Regards,  
Timo

---

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [October 27, 2009, 3:34pm UTC](https://www.ruby-forum.com/t/images-in-wxlistctrl/177984/2 "2009-10-27T15:34:03Z")

</div>

Timo S. wrote:

> API docs are unclear. There is a section about  
> “ListCtrl#set\_item\_column\_image” but it seems that this method does  
> not exist. Actually the text in this section references to  
> “ListCtrl#set\_item\_image” but it’s not clear to me how I can add for  
> example, an image to cells in the third column.

Thanks for the report. It looks like this method should be there in the  
API but is missing.

Since it’s documented and necessary we’ll aim to fix this bug, but until  
then I think the only way to have an image other than in the first  
column is to use LC\_VIRTUAL and override on\_get\_item\_column\_image, which  
should be present.

> Second problem:  
> Calling "ListCtrl#set\_item\_image(item, image) does not work for me. I  
> always have to use three paremeters when calling set\_item\_image.

Thanks again, the shorter alternative should be there but is missing.

[http://rubyforge.org/tracker/index.php?func=detail&aid=27358&group\_id=35&atid=218](http://rubyforge.org/tracker/index.php?func=detail&aid=27358&group_id=35&atid=218)

a

---

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [October 27, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/images-in-wxlistctrl/177984/3 "2009-10-27T16:01:00Z")

</div>

Hi Alex,

Am 27.10.2009 um 14:38 schrieb Alex F.:

> Since it’s documented and necessary we’ll aim to fix this bug, but  
> until then I think the only way to have an image other than in the  
> first column is to use LC\_VIRTUAL and override  
> on\_get\_item\_column\_image, which should be present.

I would like to, but I cannot find a way to get ListCtrl with  
LC\_VIRTUAL sortable by clicking in the header column. Is this  
intended, a restriction or I’m just missing any secret options?

Regards,  
Timo
