From ef711b9db183c323d26a57fe6d64163947ab7216 Mon Sep 17 00:00:00 2001 From: bagnonm Date: Fri, 3 May 2002 07:46:41 +0000 Subject: new feature, make dependence on msgcat soft, [539309] --- library/bgerror.tcl | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/library/bgerror.tcl b/library/bgerror.tcl index f18ef7b..11b51ac 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -9,16 +9,18 @@ # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: bgerror.tcl,v 1.18 2002/04/29 13:17:44 bagnonm Exp $ -# $Id: bgerror.tcl,v 1.18 2002/04/29 13:17:44 bagnonm Exp $ +# RCS: @(#) $Id: bgerror.tcl,v 1.19 2002/05/03 07:46:41 bagnonm Exp $ +# $Id: bgerror.tcl,v 1.19 2002/05/03 07:46:41 bagnonm Exp $ -option add *ErrorDialog.function.text [::tk::msgcat::mc "Save To Log"] \ +option add *ErrorDialog.function.text [namespace eval ::tk {mc "Save To Log"}] \ widgetDefault option add *ErrorDialog.function.command "::tk::dialog::error::saveToLog" namespace eval ::tk {} namespace eval ::tk::dialog {} -namespace eval ::tk::dialog::error {} +namespace eval ::tk::dialog::error { + namespace import ::tk::msgcat::* +} proc ::tk::dialog::error::Return {} { variable button @@ -52,11 +54,11 @@ proc ::tk::dialog::error::saveToLog {text} { set allFiles "*" } set types [list \ - [list [::tk::msgcat::mc "Log Files"] .log] \ - [list [::tk::msgcat::mc "Text Files"] .txt] \ - [list [::tk::msgcat::mc "All Files"] $allFiles] \ + [list [mc "Log Files"] .log] \ + [list [mc "Text Files"] .txt] \ + [list [mc "All Files"] $allFiles] \ ] - set filename [tk_getSaveFile -title [::tk::msgcat::mc "Select Log File"] \ + set filename [tk_getSaveFile -title [mc "Select Log File"] \ -filetypes $types -defaultextension .log -parent .bgerrorDialog] if {![string length $filename]} { return @@ -93,12 +95,12 @@ proc ::bgerror err { # Ok the application's tkerror either failed or was not found # we use the default dialog then : if {$tcl_platform(platform) == "macintosh"} { - set ok [::tk::msgcat::mc "Ok"] + set ok [namespace eval ::tk {mc "Ok"}] set messageFont system set textRelief "flat" set textHilight 0 } else { - set ok [::tk::msgcat::mc "OK"] + set ok [namespace eval ::tk {mc "OK"}] set messageFont {Times -18} set textRelief "sunken" set textHilight 1 @@ -125,10 +127,10 @@ proc ::bgerror err { } set w .bgerrorDialog - set title [::tk::msgcat::mc "Application Error"] - set text [::tk::msgcat::mc "Error: %1\$s" $err] - set buttons [list ok $ok dismiss [::tk::msgcat::mc "Skip Messages"] \ - function [::tk::msgcat::mc "Details >>"]] + set title [namespace eval ::tk {mc "Application Error"}] + set text [namespace eval ::tk "mc {Error: %1\$s} {$err}"] + set buttons [list ok $ok dismiss [namespace eval ::tk {mc "Skip Messages"}] \ + function [namespace eval ::tk {mc "Details >>"}]] # 1. Create the top-level window and divide it into top # and bottom parts. -- cgit v0.12