我尝试在我的wxpython程序中设置一个图标。到目前为止,在阅读了许多页面和示例后,我能够在窗口上设置一个图标,并且在使用alt + tab时也有效(我正在Windows 7上工作)。
但任务栏上的图标是通常的Python默认图标。
我不明白为什么这么简单的任务会有这么多麻烦。
以下是我的代码:
class GraphFrame(wx.Frame):
""" The main frame of the application
"""
title = 'My first wxprogram'
def __init__(self):
wx.Frame.__init__(self, None, -1, self.title)
ico = wx.Icon('dog.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
self.set_icon
self.create_menu()
self.create_status_bar()
self.create_main_panel()
#...