tktray - System Tray Icon Support for Tk on X11
Tktray is an extension that is able to create system tray icons. It follows http://www.freedesktop.org specifications when looking up the system tray manager. This protocol is supported by modern versions of KDE and Gnome panels, and by some other panel-like application.
Create a new icon for the system tray. The application managing the system tray is notified about the new icon. It normally results in the icon being added to the tray. If there is no system tray at the icon creation time, the icon will be invisible. When a new system tray appears, the icon will be added to it. Since tktray 1.3, if the tray crashes and destroys your icon, it will be recreated on a new system tray when it's available.
Post a message that any decent tray implementation would show alongside the icon (or a place allocated for it). The message will disappear automatically after $msec_timeout milliseconds. Unfortunately, there is absolutely no way to know if the tray supports this feature, so don't rely on it for any critical information to be delivered. When no timeout or zero timeout is given, the message should not be hidden without user action (usually a mouse click). The return value is an integer, a message handle that may be used for cancelling the message before timeout expiration, or zero if there is currently no system tray to handle the request.
Cancel an earlier-posted balloon message. Zero message_handle is silently ignored. If there is no message with this handle, or its timeout has expired, or it was posted to another system tray and is unknow to the current one, nothing bad should happen (but it depends on the tray implementation).
Get the list of left, top, right and bottom coordinates of the icon relative to the root window of the icon's screen. This command should be used in preference to winfo rootx and winfo rooty to get icon location, though the latter may seem to work on your system. Bounding box information is updated asynchronously. Don't rely on its correctness on script startup, just after icon creation. This command is for event handlers: on <ButtonPress-3> you'd like to have a popup menu, but where it should be posted? Use %W bbox to determine it right at the moment when a click happened.
Retrieve current option value as set by the caller.
Modify icon's options after it was created.
Query icon if it's currently embedded into some system tray. Invisible icons may be docked too (and tktray strives for it). If this method returns false, the icon is not visible to anyone, and no chance to get balloon messages displayed.
Query orientation of a system tray that is currently embedding the icon.
Current implementation of tktray is designed to present an interface of a usual toplevel window, but there are some important differences (some of them may come up later). System Tray specification is based on XEMBED protocol, and the later has a problem: when the embedder crashes, nothing can prevent embedded windows from destruction. Since tktray 1.3, no explicit icon recreation code is required on Tcl level. The widget was split in two: one represented by a caller-specified name, and another (currently $path.inner) that exists only when a tray is available (and dies and comes back and so on). This solution has some disadvantages as well. User-created widget is not mapped at all, thus it can't be used any more as a parent for other widgets, showing them instead of an image. A temporal inner window, however, may contain widgets.
This version introduces three virtual events: <<IconCreate>> <<IconConfigure>> and <<IconDestroy>>. <<IconCreate>> is generated when docking is requesting for an icon. <<IconConfigure>> is generated when an icon window is resized or changed in some other way. <<IconDestroy>> is generated when an icon is destroyed due to panel crash or undocked with unsetting -docked option.
Anton Kovalenko See http://www.sw4me.com/wiki/Tktray.
icons, system tray, taskbar
Copyright © 2005, Anton Kovalenko