• Tcl/Tk 8.7 systray eg problems

    From Mark@21:1/5 to All on Tue Jun 6 00:54:30 2023
    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.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 6 12:20:40 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark@21:1/5 to Harald Oehlmann on Tue Jun 6 03:59:10 2023
    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.
    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

    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 .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 6 13:09:51 2023
    Am 06.06.2023 um 12:59 schrieb Mark:
    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.
    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

    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 .

    Hi Mark,
    I suppose, you are also on Xfce 4.16 on Debian 11, as on your other
    post. The "wm widthdraw ." is required, that is ok.
    If the error arrives in a fossil checkout of TCL main/Tk main and
    compiled by your own, thaen this is a bug and should be reported as a
    ticket on fossil tk:
    core.tcl-lang.org/tk
    I am on WIndows only. Maybe, others including Kevin who designed that
    may comment. But a ticket is IMHO the best way to report.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark@21:1/5 to All on Tue Jun 6 04:27:35 2023
    Added a ticket that refers to this conversation: https://core.tcl-lang.org/tk/tktview/3d10c64866be5c3b371f72859a1e5f00d4caa699

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Tue Jun 6 13:41:41 2023
    Am 06.06.2023 um 13:27 schrieb Mark:
    Added a ticket that refers to this conversation: https://core.tcl-lang.org/tk/tktview/3d10c64866be5c3b371f72859a1e5f00d4caa699

    Thank you. I doubt, that a link to a google groups is a valid content
    for a ticket. My company is not allowed to use google groups due to
    European data protection laws. So we are out anyway. If you really would
    like to get an answer, a clear ticket with platform, versions, supposed behaviour, recognized behaviour is required, sorry.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Jun 6 23:43:52 2023
    Am 06.06.23 um 12:59 schrieb Mark:
    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 .

    I think this is the intended behaviour, is it not? The "." window always appears when you start wish; the [tk systray] adds an icon to the
    systray, but does not magically hide the root window. It is only logical
    that you need to withdraw it in case you want a systray-only
    application. About the other error I have no clue.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)