newbie: change application icon!

Ok, thank you! But is not possible to have a cross-platform solution?? What if I wanna this to work on linux too?

···

On 5/5/07, E. A. Tacao < e.a.tacao@estadao.com.br> wrote:

Saturday, May 5, 2007, 8:25:56 AM, Luca wrote:

I’m sorry for posting a soo simple question, I found many example in google
but no one work for me!!!

I want to use a .gif icon for my wx GUI as application icon, but I’m not
able to make this works…

Here follow many of my experiment (I used those line in combination)…

    #self.fbicon = wx.TaskBarIcon()
    #self.fbicon.SetIcon(wx.Icon("images/dvd.gif", wx.BITMAP_TYPE_GIF

),

“qqqq”)

    icon = wx.Icon("images/dvd.gif", wx.BITMAP_TYPE_GIF)
    #bitmap = wx.Bitmap("images/dvd.gif", wx.BITMAP_TYPE_GIF)
    #image = wx.Image("images/dvd.gif", wx.BITMAP_TYPE_GIF)
    #image = image.ConvertToBitmap()
    #icon = wx.EmptyIcon()
    #icon.CopyFromBitmap(image)

    self.SetIcon(icon)

self is my wx.Frame subobject

The first two line works very well if uncommented, but I don’t want
a system tray icon!

I think this should work:

icon = wx.Icon(“images/dvd.gif”, wx.BITMAP_TYPE_GIF)
self.SetIcon(icon)

But if you’re on Windows, perhaps it would be better to use some
image/icon editor to convert that .gif file into an .ico file. While

you are at it, create both a 16x16 and a 32x32 image and pack them
inside the same .ico file so that Windows will be able to pick images
both for the app caption and the task manager entry.

– tacao

No bits were harmed during the making of this e-mail.


To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Saturday, May 5, 2007, 3:24:11 PM, Luca wrote:

Ok, thank you! But is not possible to have a cross-platform
solution??

Probably.

What if I wanna this to work on linux too?

I don't know. I hope someone with more wxPython/Linux experience than
me answers that. :wink:

-- tacao

No bits were harmed during the making of this e-mail.

The most easy way of embedding images is using img2py in the wx tools
directory in the wxPython site_packages dir. Simply execute it, and
feed it an image and the file that should be created holding data for
that image.

In the python file a few methods are created, getBitmap, getImage and
getData which can be accessed to directly create a wxBitmap if needed,
I am sure a wxIcon can be somehow constructed from that as well

- Jorgen

···

On 5/6/07, E. A. Tacao <e.a.tacao@estadao.com.br> wrote:

Saturday, May 5, 2007, 3:24:11 PM, Luca wrote:

> Ok, thank you! But is not possible to have a cross-platform
> solution??

Probably.

> What if I wanna this to work on linux too?

I don't know. I hope someone with more wxPython/Linux experience than
me answers that. :wink:

-- tacao

No bits were harmed during the making of this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

E. A. Tacao wrote:

Saturday, May 5, 2007, 3:24:11 PM, Luca wrote:

What if I wanna this to work on linux too?

I don't know. I hope someone with more wxPython/Linux experience than
me answers that. :wink:

It should work fine on any of the platforms, unless something like the size of your image violates a platform standard. 32x32 should always be safe, but there is probably some wiggle room there.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!