diff options
author | Kevin Walzer <kw@codebykevin.com> | 2021-09-04 13:45:36 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2021-09-04 13:45:36 (GMT) |
commit | 698a69c2c681aff33189510cec88aa142be86d42 (patch) | |
tree | c7c268d3d0419cb00d9ced65dbadc5a5f0f9780d /library/iconbadges.tcl | |
parent | 1ca56b240164a394dc866799f5fa787531309ebe (diff) | |
download | tk-698a69c2c681aff33189510cec88aa142be86d42.zip tk-698a69c2c681aff33189510cec88aa142be86d42.tar.gz tk-698a69c2c681aff33189510cec88aa142be86d42.tar.bz2 |
More cleanup of errors
Diffstat (limited to 'library/iconbadges.tcl')
-rw-r--r-- | library/iconbadges.tcl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/iconbadges.tcl b/library/iconbadges.tcl index 964ef4b..d9d81ac 100644 --- a/library/iconbadges.tcl +++ b/library/iconbadges.tcl @@ -208,12 +208,17 @@ if {[tk windowingsystem] eq "x11"} { variable ::tk::icons::base_icon if {![info exists ::tk::icons::base_icon($win)]} { - puts "Unable to set icon badge" + puts "::tk::icons::base_icon($win) must be set on X11" return -code error } wm iconphoto $win $::tk::icons::base_icon($win) + if {$::tk::icons::base_icon($win) ni [image names]} { + puts "can't use \"$::tk::icons::base_icon($win)\" as iconphoto: not a photo image" + return -code error + } + if {$badgenumber eq ""} { return } |