blob: 192cf2dc3add73c37436c5d110ecec4ffae02f24 (
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
|
.\" 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\fP \fIimage\fP? \fItext\fP? \fIcallback\fR?
.sp
\fBtk systray modify image\fI image\fR?
.sp
\fBtk systray modify text \fI text\fR?
.sp
\fBtk systray modify 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 a callback is bound to <Button-1>.
.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"}
.CE
.PP
Here is an example of modifying the \fBtk systray\fP icon:
.CS
image create book_page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7
tk systray modify image book_page
tk systray modify text "Updated sample"
tk systray modify callback {puts "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
should be displayed, although it 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 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.
.SH KEYWORDS
image, callback
|