(wxPython) icon on panel

kyosohma at gmail.com kyosohma at gmail.com
Mon Sep 17 09:06:15 EDT 2007


On Sep 16, 3:42 am, Jimmy <mcknight0... at gmail.com> wrote:
> 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




More information about the Python-list mailing list