wxTaskBar question

Hi list,
I have a problem showing the TaskBarIcon: I can't able to show it!

It seem that wx show and hide the icon from the task bar.
This is the code that reproduce the strange behavior.
Another thing is that you try to uncomment the "t.Show" method (that
doesn't exists as TBI), you'll see an error, but the icon appear!

Thanks,
Michele

<-code->

import wx

class f1(wx.Frame):
   def __init__(self, parent):
     super(f1, self).__init__(parent)
     self.Show()
     wx.CallAfter(self.ca)

   def ca(self):
     t = wx.TaskBarIcon()
     bmp = wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_MENU,(16,16))
     t.SetIcon(wx.IconFromBitmap(bmp), "Test")
     print t.IsIconInstalled()
     #t.Show()

app = wx.PySimpleApp()
f = f1(None)
app.MainLoop()

Michele Petrazzo wrote:

Hi list,
I have a problem showing the TaskBarIcon: I can't able to show it!

It seem that wx show and hide the icon from the task bar.
This is the code that reproduce the strange behavior.
Another thing is that you try to uncomment the "t.Show" method (that
doesn't exists as TBI), you'll see an error, but the icon appear!

  def ca(self):
    t = wx.TaskBarIcon()
    bmp = wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_MENU,(16,16))
    t.SetIcon(wx.IconFromBitmap(bmp), "Test")
    print t.IsIconInstalled()
    #t.Show()

You need to keep a reference to the taskbar icon.

···

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