[wxruby-users] Icon issues

Alex Fenton alex at pressure.to
Wed Jul 30 18:14:13 EDT 2008


Glen Holcomb wrote:
> 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.
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


More information about the wxruby-users mailing list