On Sep 16, 3:42 am, Jimmy <mcknight0...@gmail.comwrote:
hi,all!
have you used 'dictionary' of linux, the program that rests on the
panel as an icon, and when you click on the icon, it will display a
window and do something. So i'm wondering how to achieve this. I guess
it's a dialog window, right? but the crucial part is how to minimize
the program to an icon on the panel and make it responsive to the
click event.
thanks in advance!
I've never used this "dictionary" program you're talking about, but I
think I know what you mean. I would recommend that you download the
wxPython Demo and open the main.py file in the "wxPython2.8 Docs and
Demos\demo" subdirectory. There's a class in there called
"DemoTaskBarIcon" which you can use to figure out how to do the whole
iconizing thing.
As for how to minimize to an icon, this is how I do it:
# bind the frame/app to wx.EVT_ICONIZE
self.Bind(wx.EVT_ICONIZE, self.onMinimize)
# hide the frame
def onMinimize(self, event):
self.frame.Hide()
If you can't get it to work, please ask for help on the wxPython
mailing list:
http://www.wxpython.org/maillist.php
They're quite helpful.
Mike