RE: How to put something in system tray?



I've been using gaim for a long time now.  It is written with gtk and
compiles for both windows and linux.  I noticed that whether gaim runs
in KDE, Gnome, XFCE4, Windows or other os/window managers it always
manages to successfully put a button in the system tray (notification
area).  

Hi,

Note, under Gnome, it is known as the Notification Area.  Under Windows
it is the System Tray, under KDE, I'm not sure what they call it.  I'm
not sure how XFCE4 works either.

I believe the http://freedesktop.org outlines how the Notification area
should work (I believe across all desktops that comply, which should
include KDE and Gnome, perhaps XFCE4???)

How is this done?  Is it even done using GTK or something else?
Is it possible to do it in a program written in pygtk?  I'm thinking I
don't want to write this project in C because it will just make it
more
difficult.  Thanks in advance.

There is no ONE method to do it on Windows and Linux.

With Gnome, I have used libegg's eggtrayicon code.  For Windows, I use
the ShellNotify() API.

If you want to see how to do it, it is probably best if you look at the
source for GAIM or Gnome Jabber, even Gossip uses the Notification Area.

This is the source directory (cvs.gnome.org):
http://cvs.gnome.org/bonsai/rview.cgi?dir=gnome-jabber%2Fsrc&rev=&module
=default&cvsroot=%2Fcvs%2Fgnome

Look for eggtrayicon.[ch] and gj_gtk_docklet.[ch] which use the
eggtrayicon code (gj_gtk_docklet.c is a little crude but the code works
for Windows and Gnome).

For Gossip, again the eggtrayicon.[ch] files are there, and gossip-app.c
(line 1852) makes use of it.

Regards,
Martyn




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]