diff options
author | dgp <dgp@users.sourceforge.net> | 2008-12-09 21:22:55 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-12-09 21:22:55 (GMT) |
commit | 8dbcb4b276318e6b06a7f576e0f5c87875a52a67 (patch) | |
tree | e39ebc39fa16df5aad460109866ff73b8cbf2df6 /macosx | |
parent | 9d585802147a2634f25b95e7b75438b0262737e8 (diff) | |
download | tk-8dbcb4b276318e6b06a7f576e0f5c87875a52a67.zip tk-8dbcb4b276318e6b06a7f576e0f5c87875a52a67.tar.gz tk-8dbcb4b276318e6b06a7f576e0f5c87875a52a67.tar.bz2 |
TIP 337
* generic/tkBind.c: Updated callers of Tcl_BackgroundError()
* generic/tkCanvas.c: to use the new routine
* generic/tkEntry.c: Tcl_BackgroundException() as appropriate.
* generic/tkImgBmap.c:
* generic/tkListbox.c:
* generic/tkSelect.c:
* generic/tkTextDisp.c:
* generic/tkTextWind.c:
* macosx/tkMacOSXHLEvents.c:
* macosx/tkMacOSXMenu.c:
* macosx/tkMacOSXMenus.c:
* macosx/tkMacOSXScale.c:
* macosx/tkMacOSXWindowEvent.c:
* unix/tkUnixScale.c:
* unix/tkUnixWm.c:
* win/tkWinButton.c:
* win/tkWinMenu.c:
* win/tkWinScrlbr.c:
* win/tkWinWm.c:
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 38 | ||||
-rw-r--r-- | macosx/tkMacOSXMenu.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXMenus.c | 20 | ||||
-rw-r--r-- | macosx/tkMacOSXScale.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 4 |
5 files changed, 42 insertions, 30 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 2f5a0b7..500faf5 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.18 2008/09/02 16:10:55 das Exp $ + * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.19 2008/12/09 21:22:56 dgp Exp $ */ #include "tkMacOSXPrivate.h" @@ -208,8 +208,9 @@ OappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){ - if (Tcl_GlobalEval(interp, "::tk::mac::OpenApplication") != TCL_OK) { - Tcl_BackgroundError(interp); + int code = Tcl_GlobalEval(interp, "::tk::mac::OpenApplication"); + if (code != TCL_OK) { + Tcl_BackgroundException(interp, code); } } return noErr; @@ -244,8 +245,9 @@ RappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ReopenApplication", &dummy)) { - if (Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication") != TCL_OK){ - Tcl_BackgroundError(interp); + int code = Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication"); + if (code != TCL_OK){ + Tcl_BackgroundException(interp, code); } } return err; @@ -279,8 +281,9 @@ PrefsHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){ - if (Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences") != TCL_OK) { - Tcl_BackgroundError(interp); + int code = Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences"); + if (code != TCL_OK) { + Tcl_BackgroundException(interp, code); } } return noErr; @@ -317,6 +320,7 @@ OdocHandler( AEKeyword keyword; Tcl_DString command, pathName; Tcl_CmdInfo dummy; + int code; /* * Don't bother if we don't have an interp or the open document procedure @@ -367,9 +371,10 @@ OdocHandler( * Now handle the event by evaluating a script. */ - if (Tcl_EvalEx(interp, Tcl_DStringValue(&command), - Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) { - Tcl_BackgroundError(interp); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); + if (code != TCL_OK) { + Tcl_BackgroundException(interp, code); } Tcl_DStringFree(&command); return noErr; @@ -406,6 +411,7 @@ PrintHandler( AEKeyword keyword; Tcl_DString command, pathName; Tcl_CmdInfo dummy; + int code; /* * Don't bother if we don't have an interp or the print document procedure @@ -451,9 +457,10 @@ PrintHandler( * Now handle the event by evaluating a script. */ - if (Tcl_EvalEx(interp, Tcl_DStringValue(&command), - Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) { - Tcl_BackgroundError(interp); + code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); + if (code != TCL_OK) { + Tcl_BackgroundException(interp, code); } Tcl_DStringFree(&command); return noErr; @@ -620,13 +627,14 @@ ReallyKillMe( Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; Tcl_CmdInfo dummy; int quit = Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy); + int code = Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit"); - if (Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit") != TCL_OK) { + if (code != TCL_OK) { /* * Should be never reached... */ - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, code); } return 1; } diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 73ccbae..331befa 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.48 2008/12/07 16:36:26 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.49 2008/12/09 21:22:56 dgp Exp $ */ #include "tkMacOSXPrivate.h" @@ -2189,7 +2189,7 @@ EventuallyInvokeMenu ( if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(realData->menuPtr->interp, "\n (menu invoke)"); - Tcl_BackgroundError(realData->menuPtr->interp); + Tcl_BackgroundException(realData->menuPtr->interp, code); } if (realData->menuPtr->tkwin) { @@ -4076,7 +4076,7 @@ TkMacOSXPreprocessMenu(void) && (code != TCL_BREAK)) { Tcl_AddErrorInfo(currentMenuBarInterp, "\n (menu preprocess)"); - Tcl_BackgroundError(currentMenuBarInterp); + Tcl_BackgroundException(currentMenuBarInterp, code); } Tcl_Release(currentMenuBarInterp); } diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index 89867fe..7bfcca5 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.23 2008/12/07 16:36:26 das Exp $ + * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.24 2008/12/09 21:22:56 dgp Exp $ */ #include "tkMacOSXPrivate.h" @@ -102,6 +102,7 @@ TkMacOSXHandleMenuSelect( Window window; TkDisplay *dispPtr; Tcl_CmdInfo dummy; + int code; if (theItem == 0) { TkMacOSXClearMenubarActive(); @@ -116,9 +117,10 @@ TkMacOSXHandleMenuSelect( Tcl_GetCommandInfo(gInterp, "tkAboutDialog", &dummy) == 0) { TkAboutDlg(); } else { - if (Tcl_EvalEx(gInterp, "tkAboutDialog", -1, - TCL_EVAL_GLOBAL) != TCL_OK) { - Tcl_BackgroundError(gInterp); + code = Tcl_EvalEx(gInterp, "tkAboutDialog", -1, + TCL_EVAL_GLOBAL); + if (code != TCL_OK) { + Tcl_BackgroundException(gInterp, code); } Tcl_ResetResult(gInterp); } @@ -138,8 +140,9 @@ TkMacOSXHandleMenuSelect( Tcl_GetStringFromObj(path, &len); if (len) { Tcl_IncrRefCount(path); - if (Tcl_FSEvalFile(gInterp, path) == TCL_ERROR) { - Tcl_BackgroundError(gInterp); + code = Tcl_FSEvalFile(gInterp, path); + if (code != TCL_OK) { + Tcl_BackgroundException(gInterp, code); } Tcl_DecrRefCount(path); } @@ -153,8 +156,9 @@ TkMacOSXHandleMenuSelect( if (path) { Tcl_IncrRefCount(path); - if (Tcl_FSEvalFile(gInterp, path) == TCL_ERROR) { - Tcl_BackgroundError(gInterp); + code = Tcl_FSEvalFile(gInterp, path); + if (code != TCL_OK) { + Tcl_BackgroundException(gInterp, code); } Tcl_DecrRefCount(path); Tcl_ResetResult(gInterp); diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index dc5d06d..7de157d 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXScale.c,v 1.15 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXScale.c,v 1.16 2008/12/09 21:22:56 dgp Exp $ */ #include "tkMacOSXPrivate.h" @@ -174,7 +174,7 @@ TkpDisplayScale( result = Tcl_VarEval(interp, scalePtr->command, " ", string, NULL); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command executed by scale)"); - Tcl_BackgroundError(interp); + Tcl_BackgroundException(interp, result); } Tcl_Release((ClientData) interp); } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 093e842..28658c9 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -48,7 +48,7 @@ * permission to use and distribute the software in accordance with the * terms specified in this license. * - * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.33 2008/10/05 21:26:11 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.34 2008/12/09 21:22:56 dgp Exp $ */ #include "tkMacOSXPrivate.h" @@ -891,7 +891,7 @@ TkWmProtocolEventProc( Tcl_AddErrorInfo(interp, Tk_GetAtomName((Tk_Window) winPtr, protocol)); Tcl_AddErrorInfo(interp, "\" window manager protocol)"); - Tk_BackgroundError(interp); + Tk_BackgroundException(interp, result); } Tcl_Release(interp); Tcl_Release(protPtr); |