Hi, I’m trying to figure out a way to remove icon from taskbar once an app is restored. I think this is a nice thing to do for users because many programs put too many icons in the taskbar without any need, and once the app is restored, in my program, the taskbar icon isn’t supposed to do anything at all. So far what I got working is that there’s no taskbar icon initially, then when a minimize to taskbar button is pressed, the app is minimized to bar, then when you double click on the taskbar icon, it is restored but the call self.trayicon.RemoveIcon() does not remove the icon. I also tried Destroy(), Unbind(), Disconnect(), and doing del self.trayicon. Nothing helps. I tried this both in windows and linux, same thing.
My code:
def on_restore(self, e):
"""Restore from taskbar."""
# self.trayicon.Unbind()
self.trayicon.RemoveIcon()
# self.trayicon.Destroy()
# self.trayicon.Disconnect()
if self.IsIconized():
self.Iconize(False)
if not self.IsShown():
self.Show(True)
self.Raise()
And event is registered:
self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.on_restore)
I also tried wx.EVT_MAXIMIZE
I googled without luck, and searched this list’s archive too.
Anyone know? -ak