blob: da646360b44cefc97ecea4cdbd45a8bfc8ea1f1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
.\" Text automatically generated by txt2man
'\"
'\" Copyright (c) 2020 Kevin Walzer/WordTech Communications LLC.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH tk systray n "" Tk "Tk Built-In Commands"
.so man.macros
.SH NAME
systray \- Creates an icon display in the platform-specific system tray.
.SH SYNOPSIS
\fBtk systray create \fIimage text b1_callback b3_callback\fR
.sp
\fBtk systray modify image\fI image\fR
.sp
\fBtk systray modify text \fI text\fR
.sp
\fBtk systray modify b1_callback \fIcallback\fR
.sp
\fBtk systray modify b3_callback \fIcallback\fR
.sp
\fBtk systray destroy\fR
.BE
.BE
.SH DESCRIPTION
.PP
The \fBtk systray\fP command creates an icon in the platform-specific tray.
The widget is configured with a Tk image for the icon display, a string
for display in a tooltip, and callbacks that are bound to <Button-1> and
<Button-3>.
.SH EXAMPLE
.PP
Here is an example of the \fBtk systray\fP code:
.CS
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create book "tk systray sample" {puts "Here is the tk systray output"} {puts "here is alternate output"}
.CE
.PP
Here is an example of modifying the \fBtk systray\fP icon:
.CS
image create photo book_page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7
tk systray modify image book_page
tk systray modify text "Updated sample"
tk systray modify b1_callback {puts "Different output from the tk systray"}
tk systray modify b3_callback {puts "and more different output from the tk systray"}
.CE
.PP
The \fBtk systray\fP destroy command removes the icon from display and
deallocates it.
.PP
From a user-interface standpoint, only one icon per interpreter is
supported; attempts to create additional icons will return an error. The
existing tray icon can be modified with different images and
strings to indicate app state. Loading additional interpreters into a
running instance of Wish will allow additional icons to be displayed.
.SH PLATFORM NOTES
.PP
The X11 implementation is supported on a "best efforts" basis because it is dependent on the window manager. The "text"
flag, which is implemented as a tooltip, does not always display if the WM
does not support such features; the systray icon itself may not even
display with some window managers.
.SH KEYWORDS
image, callback
|