# Icon issues

**URL:** <https://www.ruby-forum.com/t/icon-issues/144558>\
**Category:** wxRuby\
**Created:** [July 30, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/icon-issues/144558 "2008-07-30T21:57:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/34f0e0/32.png) [@Glen\_H](https://www.ruby-forum.com/u/Glen_H)\
**Post date:** [July 30, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/icon-issues/144558/1 "2008-07-30T21:57:47Z")

</div>

Hello all,

I have another strange issue.

I want to decorate the main window (frame) of my application with an  
icon.  
I have the icon in xpm format. With the following code:

```
# Icon stuff!!!
icon_file = File.join(File.dirname( __FILE__ ), 'circadian.xpm')
icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM)
set_icon(icon)

```

Things seem to run okay but I don’t get an icon. If I use the same icon  
file for a TaskBarIcon it works perfectly.

I don’t get any errors but I don’t get an icon either. Any suggestions?  
This appeared to be how it was being set in the big demo.

-Glen

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![Glen\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/34f0e0/32.png) [@Glen\_H](https://www.ruby-forum.com/u/Glen_H)\
**Post date:** [July 31, 2008, 12:16am UTC](https://www.ruby-forum.com/t/icon-issues/144558/2 "2008-07-31T00:16:28Z")

</div>

Glen H. wrote:

> I don’t get any errors but I don’t get an icon either. Any  
> suggestions? This appeared to be how it was being set in the big demo.  
> Your code looks fine. I’d check whether the icon is the right size for  
> the OS (you don’t say which). Windows XP expects 16x16 for the task bar  
> & title bar corner icon, and 32x32 for the ALT-TAB task-list pane. Use  
> IconBundle to get both.

There are some sample icons in bigdemo.rb sample - do these icon files  
work? If so, it may be some other problem with your .xpm file; you could  
try using PNG as a cross-platform alternative.

cheers  
alex

---

<div class="post-metadata">

**Author:** ![Glen\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/34f0e0/32.png) [@Glen\_H](https://www.ruby-forum.com/u/Glen_H)\
**Post date:** [August 1, 2008, 12:02am UTC](https://www.ruby-forum.com/t/icon-issues/144558/3 "2008-08-01T00:02:37Z")

</div>

On Wed, Jul 30, 2008 at 4:14 PM, Alex F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Things seem to run okay but I don’t get an icon. If I use the same icon  
> > There are some sample icons in bigdemo.rb sample - do these icon files  
> > work? If so, it may be some other problem with your .xpm file; you could try  
> > using PNG as a cross-platform alternative.
> 
> cheers  
> alex
> 
> * * *
> 
> wxruby-users mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [http://rubyforge.org/mailman/listinfo/wxruby-users](http://rubyforge.org/mailman/listinfo/wxruby-users)

Thanks Alex,

I was on Windows and using PNGs fixed my problem. I had assumed  
incorrectly  
that since the xpm worked for the taskbar it would work with the rest of  
the  
app.

-Glen

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)
