views:

447

answers:

3

How do I put a program in the system tray (I don't think it's called like that in Linux) in python TKINTER for UBUNTU 9.04.

+6  A: 

I don't believe you can do that using Tkinter. You will have to use the gtk libraries.

An example, found on a Ubuntu forum: http://ubuntuforums.org/showpost.php?s=bc369fc9343ae728577f1bdcd292caca&p=1053546&postcount=3

Here's an example (in Perl) of combining gtk and Tk. Gtk handles the tray icon, and the rest of the app uses Tk: http://www.perlmonks.org/?node_id=626617

codeape
1+ for the nice example
Diego Castro
i used this same post for a project back in college!, super easy
Hortinstein
+5  A: 

You have to use GTK. Do note that Ubuntu 10.04+ have a new, incompatible system tray. It's called AppIndicator; there's a python example here: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Python%20version

snostorm
+1  A: 

There is the sytem tray protocol, which I believe both gnome and kde use. You might be able to use it straight from python using ctype to call X11 methods. But I would go with the GTK solution.

mikerobi