Skip to content

gh-153259: Add tkinter.systray -- system tray icon and notifications#153260

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-systray
Open

gh-153259: Add tkinter.systray -- system tray icon and notifications#153260
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:tkinter-systray

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 7, 2026

Copy link
Copy Markdown
Member

Add a tkinter.systray module wrapping the tk systray and tk sysnotify commands (Tk 8.7/9.0 and newer), which display a system tray (or taskbar) icon and send desktop notifications.

  • SysTrayIcon wraps tk systray. Only one icon exists per Tcl interpreter, so SysTrayIcon is a handle to it: with exists=False (the default) a new icon is created (and a second one raises TclError), and with exists=True the instance refers to the already-existing icon. It supports the image, text, button1 and button3 options, configure()/config(), cget(), exists() and destroy().
  • notify() and SysTrayIcon.notify() wrap tk sysnotify. On Windows a notification requires an existing tray icon, so the module function is for the other platforms and the method for Windows.

The tests require a GUI and create a real tray icon, so they are skipped where one cannot be created.

…tions

Add the tkinter.systray module with the SysTrayIcon class wrapping the
"tk systray" command and the notify() function wrapping "tk sysnotify"
(Tk 8.7/9.0 and newer).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant