This is a bit off my original question but the above problem was my
fault for not using "twapi::systemtray remove_icon". After fixing that,
running the app using tclsh from the command line gives no error: both
wish's icon and my icon appear in the system tray and both icons are now
removed when the app exits.
As mentioned by Oliver in response to my original question, it seems
that the only way to remove the wish icon is to create a starkit or
something like that for my app. That's more trouble than I'm willing to
undertake for an app that I'd share with one other person max. I'll just
tell them how to create a shortcut.
FWIW, here's my test app:
package require Tk
package require twapi
button .quit -text quit -command Quit
pack .quit
proc TbarHandle { id event loc time } {
switch -exact $event {
"lbuttondown" {
switch -exact [wm state .] {
normal {
wm iconify .
}
iconic -
withdrawn {
wm deiconify .
}
}
}
}
}
proc Quit {} {
twapi::systemtray removeicon $::iconid
twapi::free_icon $::hicon
exit
}
set hicon [ twapi::load_icon_from_file BL2Logo.ico ]
set iconid [ twapi::systemtray addicon $hicon TbarHandle ]