diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-27 19:48:23 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-08-27 19:48:23 (GMT) |
commit | 55ad282f48e04748a7cf3d375ad3fc2abb47c0a1 (patch) | |
tree | c8cd1c66faa65fac8be9a9a85c0fc3ba7b8a564f /library/fontchooser.tcl | |
parent | bd27ced6025b5ce285080806ecd44c8b9bc1786a (diff) | |
parent | ef65c6ff80f269b8e94aa1ff98e76831b93c4550 (diff) | |
download | tk-55ad282f48e04748a7cf3d375ad3fc2abb47c0a1.zip tk-55ad282f48e04748a7cf3d375ad3fc2abb47c0a1.tar.gz tk-55ad282f48e04748a7cf3d375ad3fc2abb47c0a1.tar.bz2 |
Generate -errorcode values to go with errors. Generate messages and postscript
using Tcl_Obj API, not the string result API.
Diffstat (limited to 'library/fontchooser.tcl')
-rw-r--r-- | library/fontchooser.tcl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index 13b5895..179476c 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -96,7 +96,8 @@ proc ::tk::fontchooser::Configure {args} { } elseif {[info exists S($option)]} { return $S($option) } - return -code error "bad option \"$option\": must be\ + return -code error -errorcode [list TK LOOKUP OPTION $option] \ + "bad option \"$option\": must be\ -command, -font, -parent, -title or -visible" } @@ -104,9 +105,10 @@ proc ::tk::fontchooser::Configure {args} { -font $S(-font) -command $S(-command)] set r [tclParseConfigSpec [namespace which -variable S] $specs "" $args] if {![winfo exists $S(-parent)]} { + set code [list TK LOOKUP WINDOW $S(-parent)] set err "bad window path name \"$S(-parent)\"" array set S $cache - return -code error $err + return -code error -errorcode $code $err } if {[string trim $S(-title)] eq ""} { set S(-title) [::msgcat::mc "Font"] @@ -434,9 +436,9 @@ proc ::tk::fontchooser::ttk_slistbox {w args} { grid columnconfigure $f 0 -weight 1 interp hide {} $w interp alias {} $w {} $f.list - } err]} { + } err opt]} { destroy $f - return -code error $err + return -options $opt $err } return $w } |