TIP #325: System Tray Access

Title:System Tray Access
Version:$Revision: 1.2 $
Author:David N. Welton <davidw at dedasys dot com>
Created:Monday, 25 August 2008
Keywords:Tk, desktop integration


Modern operating systems have a "system tray", where programs may place an icon to indicate program status. This TIP proposes that Tk should adopt some existing code in order to permit cross platform access to this functionality.

Existing code

* Windows


* Linux


* Mac


Existing code is sufficient, and utilizes an acceptable license in order to repurpose it for a systray command.


To be determined by the TCT, but along the lines of what tktray provides:

tktray::icon pathName ?options?

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. Options:


WM_CLASS attribute for the icon window. Tray manager may use class name to remember icon position or other attributes.


image to show in the system tray. The value must be the name of a photo image. Transparency data of the photo are used to set the window's shape. The icon will be automatically redrawn or resized appropriately on any image modifications.


boolean value indicating whether the icon must be visible. The system tray manager continues to manage the icon whether it is visible or not. Thus when invisible icon becomes visible, its position on the system tray is likely to remain the same.


This document has been placed in the public domain.

Powered by Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows