[pygtk] Minimizing an application to the tray

François Ingelrest athropos at gmail.com
Wed Nov 7 16:21:21 WST 2007


If you want to 'replace' the minimize function, all you have to do is
to install an handler to catch changes of your window's states. When
it is minimized, you simply hide it and you create a StatusIcon that
will automatically appear in the tray area. A StatusIcon also lets you
catch clicks performed on the tray icon, so upon a click you show the
window and you remove the StatusIcon from the tray area.

Is that what you want to do?

On Nov 7, 2007 2:28 AM, Alec Hussey <alec.hussey at gmail.com> wrote:
> Hello all,
>
> I am developing an application where I would like to have the main
> window minimized to the system tray or notification area. Except, I
> haven't been able to find much information on how to do this. I found
> gtk.StatusIcon in the PyGTK docs however I'm not sure how exactly I
> would be able to integrate this into my Window's actions. Because I want
> to keep the applications current state, but simply hide the window and
> keep a tray icon in its place. Then when the user wants to use the
> application again they can just click on the icon in the tray.
>
> What's going to be the simplest way I can accomplish this? And how do
> you suggest I should do it?


More information about the pygtk mailing list