Fwd: system tray or notification area in python

Christian Gollwitzer auriocus at gmx.de
Tue Oct 16 17:56:39 EDT 2012


Am 16.10.12 22:39, schrieb Daniel Fetchinson:
>>> Hi folks,
>>> So I thought I would write a brand new stand alone system tray or
>>> notification area in python. I guess I need to use gtk bindings or
>>> some such but don't really know what my options are.
>>>
>>> Where would I start something like this?
>>> Any pointers would be greatly appreciated!
>>>
>> Why not look at the source code of the current app your using to get
>> an idea how that application accomplishes said task?
>
> I actually did that already it's using the C bindings of gtk.

I think you are mistaken - if its this one:
	http://stalonetray.sourceforge.net/

I had a quick look into the sources, it does not use gtk at all, it uses 
low level X11 calls. Programming in this way is very tedious.

> But I have zero experience with gui programming in python. So any
> pointers would be much appreciated how to implement a system tray in
> python. Gtk is I guess just one option, one could use other stuff from
> python but I wouldn't know what the simplest approach is.

I'm not sure it is even possible. "Usual" GUI applications just need to 
request certain features from their window manager such as the setting 
the program icon or requesting a certain position on the screen. That is 
what is implemented in the usual toolits like Tk, QT, and gtk.

A window manager, on the other hand, must be able to recieve and 
interpret these messages. For a system tray, they are described here:

http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.3.html

I have not studied the whole interface of the aforementioned toolkits, 
but I suspect that there is no way around writing low level Xlib code in 
order to recieve these messages.

Don't take it wrong, but when you write that you have no experience with 
GUI programming, I'd start another projet first - I think you will have 
a tough way to succeed with this project.

	Christian



More information about the Python-list mailing list