I've just installed the Tcl/Tk 8.7a's.
In https://www.tcl.tk/man/tcl8.7/TkCmd/systray.html two egs are given.
The first one fails with:
Error in startup script: systray not created
while executing
"tk systray configure -image book_page -text "Updated sample" \
-button1 {puts "Different output from the tk systray"} \
-button3 {puts "and more dif..."
(file "/tmp/a.tcl" line 3)
But the second one works. However, the second one also creates a spurious main window, so I think the complete second example should be this:
#!/usr/bin/env wish
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create -image book -text "tk systray sample" \
-button1 {puts "Here is the tk systray output"} \
-button3 {puts "here is alternate output"}
wm withdraw .
(Note that the line starting `image create` is a single line up to and including the `==` at the end.)
Am 06.06.2023 um 09:54 schrieb Mark:
I've just installed the Tcl/Tk 8.7a's.
In https://www.tcl.tk/man/tcl8.7/TkCmd/systray.html two egs are given.
The first one fails with:
Error in startup script: systray not created
while executing
"tk systray configure -image book_page -text "Updated sample" \
-button1 {puts "Different output from the tk systray"} \
-button3 {puts "and more dif..."
(file "/tmp/a.tcl" line 3)
But the second one works. However, the second one also creates a spurious main window, so I think the complete second example should be this:
#!/usr/bin/env wish
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create -image book -text "tk systray sample" \
-button1 {puts "Here is the tk systray output"} \
-button3 {puts "here is alternate output"}
wm withdraw .
(Note that the line starting `image create` is a single line up to and including the `==` at the end.)Hi Mark,
it would be great, if you could try:
- TCL fossil main (9.0) or fossil core-8-branch (8.7)
- Tk fossil main (8.7) branch
You should compile on your own. Some wizards are able to extract the binaries from the github actions, but not me.
I suppose, many bugs are already fixed there.
If you are on Windows, TWAPI has great systray capabilities.
Thank you and take care,
Harald
On Tuesday, June 6, 2023 at 11:20:43 AM UTC+1, Harald Oehlmann wrote:
Am 06.06.2023 um 09:54 schrieb Mark:
I've just installed the Tcl/Tk 8.7a's.Hi Mark,
In https://www.tcl.tk/man/tcl8.7/TkCmd/systray.html two egs are given.
The first one fails with:
Error in startup script: systray not created
while executing
"tk systray configure -image book_page -text "Updated sample" \
-button1 {puts "Different output from the tk systray"} \
-button3 {puts "and more dif..."
(file "/tmp/a.tcl" line 3)
But the second one works. However, the second one also creates a spurious main window, so I think the complete second example should be this:
#!/usr/bin/env wish
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create -image book -text "tk systray sample" \
-button1 {puts "Here is the tk systray output"} \
-button3 {puts "here is alternate output"}
wm withdraw .
(Note that the line starting `image create` is a single line up to and including the `==` at the end.)
it would be great, if you could try:
- TCL fossil main (9.0) or fossil core-8-branch (8.7)
- Tk fossil main (8.7) branch
You should compile on your own. Some wizards are able to extract the
binaries from the github actions, but not me.
I suppose, many bugs are already fixed there.
If you are on Windows, TWAPI has great systray capabilities.
Thank you and take care,
Harald
Hi Harald,
I tried with Tcl8.7/Tk8.7 and Tcl9.0/Tk8.7. In both cases I had to add the `wm withdraw .` command. Here's the code I used:
#!/usr/bin/env wish
puts "Tcl v$tcl_version/Tk v$tk_version"
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create -image book -text "tk systray sample" \
-button1 {puts "Here is the tk systray output"} \
-button3 {puts "Quit"; exit }
wm withdraw .
Added a ticket that refers to this conversation: https://core.tcl-lang.org/tk/tktview/3d10c64866be5c3b371f72859a1e5f00d4caa699
I tried with Tcl8.7/Tk8.7 and Tcl9.0/Tk8.7. In both cases I had to add the `wm withdraw .` command. Here's the code I used:
#!/usr/bin/env wish
puts "Tcl v$tcl_version/Tk v$tk_version"
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw==
tk systray create -image book -text "tk systray sample" \
-button1 {puts "Here is the tk systray output"} \
-button3 {puts "Quit"; exit }
wm withdraw .
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 46:59:19 |
| Calls: | 12,112 |
| Calls today: | 3 |
| Files: | 15,010 |
| Messages: | 6,518,497 |