diff --git a/gooey/gui/containers/application.py b/gooey/gui/containers/application.py index 49fac7d..9a99bfc 100644 --- a/gooey/gui/containers/application.py +++ b/gooey/gui/containers/application.py @@ -5,6 +5,7 @@ Primary orchestration and control point for Gooey. import sys import wx +from wx.adv import TaskBarIcon from gooey.gui import cli from gooey.gui import events @@ -187,7 +188,14 @@ class GooeyApplication(wx.Frame): self.SetSizer(sizer) self.console.Hide() self.Layout() - self.SetIcon(wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_ICO)) + # Program Icon (Windows) + icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG) + self.SetIcon(icon) + # OSX needs to have its taskbar icon explicitly set + # bizarrely, wx requires the TaskBarIcon to be attached to the Frame + # as instance data (self.). Otherwise, it will not render correctly. + self.taskbarIcon = TaskBarIcon(iconType=wx.adv.TBI_DOCK) + self.taskbarIcon.SetIcon(icon) diff --git a/gooey/gui/image_repository.py b/gooey/gui/image_repository.py index c29d035..dcb40da 100644 --- a/gooey/gui/image_repository.py +++ b/gooey/gui/image_repository.py @@ -12,7 +12,7 @@ from gooey.gui.util.freeze import getResourcePath from gooey.util.functional import merge filenames = { - 'programIcon': 'program_icon.ico', + 'programIcon': 'program_icon.png', 'successIcon': 'success_icon.png', 'runningIcon': 'running_icon.png', 'loadingIcon': 'loading_icon.gif', diff --git a/gooey/gui/util/freeze.py b/gooey/gui/util/freeze.py index d3a84f4..b3eb4d4 100644 --- a/gooey/gui/util/freeze.py +++ b/gooey/gui/util/freeze.py @@ -45,4 +45,3 @@ def localResourcePath(path): return os.path.join(basedir or sys.executable, path) else: return os.path.join(os.getcwd(), path) - \ No newline at end of file diff --git a/gooey/images/program_icon.png b/gooey/images/program_icon.png new file mode 100644 index 0000000..6c88234 Binary files /dev/null and b/gooey/images/program_icon.png differ