stefanB
stefanB

Reputation: 79870

How to setup application icon that shows up in Alt-Tab dialog when switching tasks on Windows?

How do I setup icon, for wxpython application on Windows, that shows up in the Alt-Tab dialog when I'm switching between applications?

The application icon in the menu bar and the corner of the running app shows my icon but when I switch between applications using Alt-Tab I can see the default square with blue outline icon.

Do I need to do something extra for my icon to show up in Alt-Tab dialog or does my icon have to include a special resolution?

In my class initializer I setup icon :

class A(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,-1,title,size=(265,434))
        favicon = wx.Icon('C:\source\python\gui\gf.ico',
                           wx.BITMAP_TYPE_ICO, 16,16)
        wx.Frame.SetIcon(self,favicon)

Upvotes: 3

Views: 5973

Answers (1)

minou
minou

Reputation: 16563

This works for me:

self.icon = wx.Icon(fn, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)

where the icon in fn has several resolutions (16, 32, and 48, I think).

Looks like you at least want to change

    wx.Frame.SetIcon(self,favicon)

to

    self.SetIcon(favicon)

Also, try removing the 16's from the wx.Icon call and making sure your icon has other resolutions.

Upvotes: 5

Related Questions