From 69c55bc6ba8daea94db4f07d448e28ba1970a0f2 Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Thu, 15 Nov 2012 19:31:20 +0000 Subject: More complete purge of things only present for supporting long-dead Mac 9 systems. --- doc/chooseDirectory.n | 5 +- doc/console.n | 2 +- doc/getOpenFile.n | 15 +- generic/default.h | 2 - generic/tk.h | 10 +- generic/tkBind.c | 2 +- generic/tkCmds.c | 4 - generic/tkConsole.c | 4 - generic/tkFileFilter.h | 4 - generic/tkGrab.c | 2 +- generic/tkImgPhoto.c | 10 +- generic/tkIntXlibDecls.h | 4 - generic/tkMain.c | 6 +- generic/tkMenu.c | 4 +- generic/tkPointer.c | 5 - generic/tkPort.h | 4 +- generic/tkSelect.c | 2 +- generic/tkStubInit.c | 9 +- generic/tkStubLib.c | 4 - generic/tkTest.c | 28 +- generic/tkText.c | 2 +- generic/tkWindow.c | 12 +- library/bgerror.tcl | 16 +- library/button.tcl | 4 +- library/console.tcl | 17 +- library/dialog.tcl | 11 +- library/entry.tcl | 2 +- library/listbox.tcl | 2 +- library/msgbox.tcl | 12 +- library/scrlbar.tcl | 2 +- library/spinbox.tcl | 2 +- library/text.tcl | 6 +- library/tk.tcl | 22 +- tests/clrpick.test | 6 +- tests/font.test | 1 - tests/macMenu.test | 1547 ---------------------------------------------- tests/macscrollbar.test | 93 --- tests/safe.test | 4 +- tests/text.test | 4 +- tests/unixMenu.test | 4 +- tests/winMenu.test | 4 +- unix/Makefile.in | 15 - unix/README | 3 +- unix/tkUnix3d.c | 2 +- unix/tkUnixDraw.c | 2 +- xlib/X11/X.h | 4 +- xlib/X11/Xlib.h | 15 +- xlib/X11/Xutil.h | 4 +- xlib/X11/keysym.h | 4 - xlib/xgc.c | 10 +- xlib/xutil.c | 9 +- 51 files changed, 86 insertions(+), 1881 deletions(-) delete mode 100644 tests/macMenu.test delete mode 100644 tests/macscrollbar.test diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index c796f86..ba18488 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -24,10 +24,7 @@ Specifies that the directories in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, then the directories in the current working directory are displayed. If the parameter specifies a relative path, the return value will convert the -relative path to an absolute path. This option may not always work on -the Macintosh. This is not a bug. Rather, the \fIGeneral Controls\fR -control panel on the Mac allows the end user to override the -application default directory. +relative path to an absolute path. .TP \fB\-parent\fR \fIwindow\fR Makes \fIwindow\fR the logical parent of the dialog. The dialog diff --git a/doc/console.n b/doc/console.n index c6ea1d1..adba6d3 100644 --- a/doc/console.n +++ b/doc/console.n @@ -22,7 +22,7 @@ a real console. It is implemented as a separate interpreter with the Tk toolkit loaded, and control over this interpreter is given through the \fBconsole\fR command. The behaviour of the console window is defined mainly through the contents of the \fIconsole.tcl\fR file in -the Tk library (or the \fIConsole\fR resource on Macintosh systems.) +the Tk library. .PP .TP \fBconsole eval \fIscript\fR diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index b13194b..535b111 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -39,7 +39,7 @@ arguments to these two commands: Specifies a string that will be appended to the filename if the user enters a filename without an extension. The default value is the empty string, which means no extension will be appended to the filename in -any case. This option is ignored on the Macintosh platform, which +any case. This option is ignored on Mac OS X, which does not require extensions to filenames, .VS 8.4 and the UNIX implementation guesses reasonable values for this from @@ -61,24 +61,17 @@ Specifies that the files in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, then the files in the current working directory are displayed. If the parameter specifies a relative path, the return value will convert the -relative path to an absolute path. This option may not always work on -the Macintosh. This is not a bug. Rather, the \fIGeneral Controls\fR -control panel on the Mac allows the end user to override the -application default directory. +relative path to an absolute path. .TP \fB\-initialfile\fR \fIfilename\fR -Specifies a filename to be displayed in the dialog when it pops up. This -option is ignored on the Macintosh platform. +Specifies a filename to be displayed in the dialog when it pops up. .TP \fB\-multiple\fR \fIboolean\fR Allows the user to choose multiple files from the Open dialog. -On the Macintosh, this is only available when Navigation Services are -installed. .TP \fB\-message\fR \fIstring\fR Specifies a message to include in the client area of the dialog. -This is only available on the Macintosh, and only when Navigation -Services are installed. +This is only available on the Mac OS X. .TP \fB\-parent\fR \fIwindow\fR Makes \fIwindow\fR the logical parent of the file dialog. The file diff --git a/generic/default.h b/generic/default.h index dd4f609..6156f4d 100755 --- a/generic/default.h +++ b/generic/default.h @@ -20,8 +20,6 @@ #else # if defined(MAC_OSX_TK) # include "tkMacOSXDefault.h" -# elif defined(MAC_TCL) -# include "tkMacDefault.h" # else # include "tkUnixDefault.h" # endif diff --git a/generic/tk.h b/generic/tk.h index e777947..4a5b371 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -60,9 +60,8 @@ extern "C" { /* * A special definition used to allow this header file to be included - * from windows or mac resource files so that they can obtain version - * information. RC_INVOKED is defined by default by the windows RC tool - * and manually set for macintosh. + * from windows resource files so that they can obtain version + * information. RC_INVOKED is defined by default by the windows RC tool. * * Resource compilers don't like all the C stuff, like typedefs and * procedure declarations, that occur below, so block them out. @@ -71,10 +70,7 @@ extern "C" { #ifndef RC_INVOKED #ifndef _XLIB_H -# if defined (MAC_TCL) -# include -# include -# elif defined(MAC_OSX_TK) +# if defined(MAC_OSX_TK) # include # include # else diff --git a/generic/tkBind.c b/generic/tkBind.c index 3003f18..3d617d4 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -19,7 +19,7 @@ #include "tkWinInt.h" #endif -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* UNIX */ +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* UNIX */ #include "tkUnixInt.h" #endif diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 16cfd8d..1e830e2 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -17,8 +17,6 @@ #if defined(WIN32) #include "tkWinInt.h" -#elif defined(MAC_TCL) -#include "tkMacInt.h" #elif defined(MAC_OSX_TK) #include "tkMacOSXInt.h" #else @@ -837,8 +835,6 @@ Tk_TkObjCmd(clientData, interp, objc, objv) } #if defined(WIN32) windowingsystem = "win32"; -#elif defined(MAC_TCL) - windowingsystem = "classic"; #elif defined(MAC_OSX_TK) windowingsystem = "aqua"; #else diff --git a/generic/tkConsole.c b/generic/tkConsole.c index af6e76a..7d9da77 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -350,11 +350,7 @@ Tk_CreateConsoleWindow(interp) int result = TCL_OK; int haveConsoleChannel = 1; -#ifdef MAC_TCL - static CONST char *initCmd = "if {[catch {source $tk_library:console.tcl}]} {source -rsrc console}"; -#else static CONST char *initCmd = "source $tk_library/console.tcl"; -#endif /* Init an interp with Tcl and Tk */ Tcl_Interp *consoleInterp = Tcl_CreateInterp(); diff --git a/generic/tkFileFilter.h b/generic/tkFileFilter.h index 8d7021e..6df986f 100644 --- a/generic/tkFileFilter.h +++ b/generic/tkFileFilter.h @@ -13,11 +13,7 @@ #ifndef _TK_FILE_FILTER #define _TK_FILE_FILTER -#ifdef MAC_TCL -#include -#else #define OSType long -#endif #ifdef BUILD_tk # undef TCL_STORAGE_CLASS diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 3f4748c..4fa7393 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -13,7 +13,7 @@ #include "tkPort.h" #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 23db11a..7c87c42 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -2770,15 +2770,7 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width, return; } - if ( -#if defined(MAC_TCL) - /* - * The retrieval of bgImg is currently not functional on OS9 - * so skip attempts to alpha blend. - */ - 0 && -#endif - (instancePtr->masterPtr->flags & COMPLEX_ALPHA) + if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA) && visInfo.depth >= 15 && (visInfo.class == DirectColor || visInfo.class == TrueColor)) { Tk_ErrorHandler handler; diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index b808233..fc12521 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -19,11 +19,7 @@ * in the generic/tkInt.decls script. */ -#ifdef MAC_TCL -#include "Xutil.h" -#else #include "X11/Xutil.h" -#endif #ifdef BUILD_tk #undef TCL_STORAGE_CLASS diff --git a/generic/tkMain.c b/generic/tkMain.c index 365e0d1..5e5ddb7 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -96,11 +96,7 @@ static int WinIsTty(int fd) { } } #else -#if !defined(MAC_TCL) extern int isatty _ANSI_ARGS_((int fd)); -#else -#include -#endif extern char * strrchr _ANSI_ARGS_((CONST char *string, int c)); #endif @@ -193,7 +189,7 @@ Tk_MainEx(argc, argv, appInitProc, interp) /* Only initialize console when not running under cygwin */ Tk_InitConsoleChannels(interp); } -#elif defined(__WIN32__) || defined(MAC_TCL) +#elif defined(__WIN32__) Tk_InitConsoleChannels(interp); #endif diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 4bcc46f..a8fd7ce 100755 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -32,9 +32,7 @@ * cascades labelled "File" and "Edit", the cascade menus might have * the pathnames .m.file and .m.edit. Another constraint is that the menus * used for menubars must be children of the toplevel widget that they - * are attached to. And on the Macintosh, the platform specific menu handle - * for cascades attached to a menu bar must have a title that matches the - * label for the cascade menu. + * are attached to. * * To handle all of the constraints, Tk menubars and tearoff menus are * implemented using menu clones. Menu clones are full menus in their own diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 949dcee..7b2408f 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -18,11 +18,6 @@ #include "tkWinInt.h" #endif -#if defined(MAC_TCL) -#include "tkMacInt.h" -#define Cursor XCursor -#endif - #if defined(MAC_OSX_TK) #include "tkMacOSXInt.h" #define Cursor XCursor diff --git a/generic/tkPort.h b/generic/tkPort.h index ca592d1..00c49fd 100644 --- a/generic/tkPort.h +++ b/generic/tkPort.h @@ -24,9 +24,7 @@ #if defined(__WIN32__) || defined(_WIN32) # include "tkWinPort.h" #else -# if defined(MAC_TCL) -# include "tkMacPort.h" -# elif defined(MAC_OSX_TK) +# if defined(MAC_OSX_TK) # include "tkMacOSXPort.h" # else # include "tkUnixPort.h" diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 2ac3424..1b65c42 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -1198,7 +1198,7 @@ TkSelInit(tkwin) * http://www.cl.cam.ac.uk/~mgk25/unicode.html#x11 */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) dispPtr->utf8Atom = Tk_InternAtom(tkwin, "UTF8_STRING"); #else dispPtr->utf8Atom = (Atom) NULL; diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 77f5379..dc22008 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -12,7 +12,7 @@ #include "tkInt.h" #include "tkPort.h" -#if !(defined(__WIN32__) && defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) && defined(MAC_OSX_TK)) /* UNIX */ #define UNIX_TK #endif @@ -20,11 +20,6 @@ #ifdef __WIN32__ #include "tkWinInt.h" #endif -#if defined(MAC_TCL) -/* set this locally .. we could have used _TKMACINT */ -#define MAC_TK -#include "tkMacInt.h" -#endif #if defined(MAC_OSX_TK) /* set this locally .. we could have used _TKMACINT */ @@ -241,7 +236,7 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) # define TkBindDeadWindow 0 /* On purpose not in Cygwin's stub table */ -# elif !defined(MAC_TCL) && !defined(MAC_OSX_TK) /* UNIX */ +# elif !defined(MAC_OSX_TK) /* UNIX */ # undef TkClipBox # undef TkCreateRegion diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 29c4851..6f19aa8 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -36,10 +36,6 @@ #include "tkWinInt.h" #endif -#ifdef MAC_TCL -#include "tkMacInt.h" -#endif - #ifdef MAC_OSX_TK #include "tkMacOSXInt.h" #endif diff --git a/generic/tkTest.c b/generic/tkTest.c index 6cb776c..78496e6 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -22,7 +22,7 @@ #include "tkWinInt.h" #endif -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) #include "tkScrollbar.h" #endif @@ -177,11 +177,11 @@ static int TestfontObjCmd _ANSI_ARGS_((ClientData dummy, Tcl_Obj *CONST objv[])); static int TestmakeexistCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestmenubarCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); #endif -#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(__WIN32__) || defined(MAC_OSX_TK) static int TestmetricsCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); #endif @@ -201,13 +201,13 @@ static void CustomOptionFree _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char *internalPtr)); static int TestpropCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestsendCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); #endif static int TesttextCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestwrapperCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int argc, CONST char **argv)); #endif @@ -225,7 +225,7 @@ static void TrivialEventProc _ANSI_ARGS_((ClientData clientData, extern int TkplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp)); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) #define TkplatformtestInit(x) TCL_OK #endif @@ -283,23 +283,23 @@ Tktest_Init(interp) (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand(interp, "testmakeexist", TestmakeexistCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) Tcl_CreateCommand(interp, "testmenubar", TestmenubarCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); #endif -#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(__WIN32__) || defined(MAC_OSX_TK) Tcl_CreateCommand(interp, "testmetrics", TestmetricsCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); #endif Tcl_CreateCommand(interp, "testprop", TestpropCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) Tcl_CreateCommand(interp, "testsend", TestsendCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); #endif Tcl_CreateCommand(interp, "testtext", TesttextCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) Tcl_CreateCommand(interp, "testwrapper", TestwrapperCmd, (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL); #endif @@ -1961,7 +1961,7 @@ TestmakeexistCmd(clientData, interp, argc, argv) */ /* ARGSUSED */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestmenubarCmd(clientData, interp, argc, argv) ClientData clientData; /* Main window for application. */ @@ -2030,7 +2030,7 @@ TestmenubarCmd(clientData, interp, argc, argv) *---------------------------------------------------------------------- */ -#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(__WIN32__) || defined(MAC_OSX_TK) static int TestmetricsCmd(clientData, interp, argc, argv) ClientData clientData; /* Main window for application. */ @@ -2182,7 +2182,7 @@ TestpropCmd(clientData, interp, argc, argv) */ /* ARGSUSED */ -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestsendCmd(clientData, interp, argc, argv) ClientData clientData; /* Main window for application. */ @@ -2357,7 +2357,7 @@ TesttextCmd(clientData, interp, argc, argv) return TCL_OK; } -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* *---------------------------------------------------------------------- * diff --git a/generic/tkText.c b/generic/tkText.c index 54f148d..fb15468 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -20,7 +20,7 @@ #include "tkInt.h" #include "tkUndo.h" -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) #define Style TkStyle #define DInfo TkDInfo #endif diff --git a/generic/tkWindow.c b/generic/tkWindow.c index c442ef4..2bccbb9 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -18,7 +18,7 @@ #ifdef __WIN32__ #include "tkWinInt.h" -#elif !(defined(MAC_TCL) || defined(MAC_OSX_TK)) +#elif !(defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif @@ -136,7 +136,7 @@ static CONST TkCmd commands[] = { {"selection", Tk_SelectionObjCmd, PASSMAINWINDOW}, {"tk", Tk_TkObjCmd, PASSMAINWINDOW|ISSAFE}, {"tkwait", Tk_TkwaitObjCmd, PASSMAINWINDOW|ISSAFE}, -#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(__WIN32__) || defined(MAC_OSX_TK) {"tk_chooseColor", Tk_ChooseColorObjCmd, PASSMAINWINDOW}, {"tk_chooseDirectory", Tk_ChooseDirectoryObjCmd, WINMACONLY|PASSMAINWINDOW}, {"tk_getOpenFile", Tk_GetOpenFileObjCmd, WINMACONLY|PASSMAINWINDOW}, @@ -175,7 +175,7 @@ static CONST TkCmd commands[] = { * Misc. */ -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) {"::tk::unsupported::MacWindowStyle", TkUnsupported1ObjCmd, PASSMAINWINDOW|ISSAFE}, #endif @@ -1461,7 +1461,7 @@ Tk_DestroyWindow(tkwin) TkWmRemoveFromColormapWindows(winPtr); } if (winPtr->window != None) { -#if defined(MAC_TCL) || defined(MAC_OSX_TK) || defined(__WIN32__) +#if defined(MAC_OSX_TK) || defined(__WIN32__) XDestroyWindow(winPtr->display, winPtr->window); #else if ((winPtr->flags & TK_TOP_HIERARCHY) @@ -1571,7 +1571,7 @@ Tk_DestroyWindow(tkwin) * display now and relinquish its data structures. */ -#if !defined(WIN32) && !defined(MAC_TCL) && defined(NOT_YET) +#if !defined(WIN32) && defined(NOT_YET) if (dispPtr->refCount <= 0) { /* * I have disabled this code because on Windows there are @@ -2113,7 +2113,7 @@ Tk_DefineCursor(tkwin, cursor) { register TkWindow *winPtr = (TkWindow *) tkwin; -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) winPtr->atts.cursor = (XCursor) cursor; #else winPtr->atts.cursor = (Cursor) cursor; diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 3372115..94db7f5 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -94,8 +94,7 @@ proc ::tk::dialog::error::bgerror err { # we use the default dialog then : set windowingsystem [tk windowingsystem] - if {($windowingsystem eq "classic") - || ($windowingsystem eq "aqua")} { + if {$windowingsystem eq "aqua"} { set ok [mc Ok] set messageFont system set textRelief flat @@ -143,8 +142,7 @@ proc ::tk::dialog::error::bgerror err { wm iconname .bgerrorDialog ErrorDialog wm protocol .bgerrorDialog WM_DELETE_WINDOW { } - if {($windowingsystem eq "classic") - || ($windowingsystem eq "aqua")} { + if {$windowingsystem eq "aqua"} { ::tk::unsupported::MacWindowStyle style .bgerrorDialog moveableAlert {} } elseif {$windowingsystem eq "x11"} { wm attributes .bgerrorDialog -type dialog @@ -190,17 +188,10 @@ proc ::tk::dialog::error::bgerror err { set wrapwidth [expr {$wrapwidth-60-[winfo pixels .bgerrorDialog 9m]}] label .bgerrorDialog.msg -justify left -text $text -font $messageFont \ -wraplength $wrapwidth - if {($windowingsystem eq "classic") - || ($windowingsystem eq "aqua")} { - # On the Macintosh, use the stop bitmap - label .bgerrorDialog.bitmap -bitmap stop - } else { - # On other platforms, make the error icon canvas .bgerrorDialog.bitmap -width 32 -height 32 -highlightthickness 0 .bgerrorDialog.bitmap create oval 0 0 31 31 -fill red -outline black .bgerrorDialog.bitmap create line 9 9 23 23 -fill white -width 4 .bgerrorDialog.bitmap create line 9 23 23 9 -fill white -width 4 - } grid .bgerrorDialog.bitmap .bgerrorDialog.msg \ -in .bgerrorDialog.top \ -row 0 \ @@ -226,8 +217,7 @@ proc ::tk::dialog::error::bgerror err { -padx 10 grid columnconfigure .bgerrorDialog.bot $i -weight 1 # We boost the size of some Mac buttons for l&f - if {($windowingsystem eq "classic") - || ($windowingsystem eq "aqua")} { + if {$windowingsystem eq "aqua"} { if {($name eq "ok") || ($name eq "dismiss")} { grid columnconfigure .bgerrorDialog.bot $i -minsize 90 } diff --git a/library/button.tcl b/library/button.tcl index 195566e..fe92034 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -16,7 +16,7 @@ # The code below creates the default class bindings for buttons. #------------------------------------------------------------------------- -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Radiobutton { tk::ButtonEnter %W } @@ -442,7 +442,7 @@ proc ::tk::ButtonUp w { } -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { #################### # Mac implementation diff --git a/library/console.tcl b/library/console.tcl index b473dd4..0dc6f63 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -48,8 +48,7 @@ proc ::tk::ConsoleInit {} { wm withdraw . } - if {$tcl_platform(platform) eq "macintosh" - || [tk windowingsystem] eq "aqua"} { + if {[tk windowingsystem] eq "aqua"} { set mod "Cmd" } else { set mod "Ctrl" @@ -66,8 +65,7 @@ proc ::tk::ConsoleInit {} { -underline 0 -command {wm withdraw .} .menubar.file add command -label [mc "Clear Console"] \ -underline 0 -command {.console delete 1.0 "promptEnd linestart"} - if {$tcl_platform(platform) eq "macintosh" - || [tk windowingsystem] eq "aqua"} { + if {[tk windowingsystem] eq "aqua"} { .menubar.file add command -label [mc "Quit"] \ -command exit -accel Cmd-Q } else { @@ -103,9 +101,6 @@ proc ::tk::ConsoleInit {} { pack .sb -side right -fill both pack $con -fill both -expand 1 -side left switch -exact $tcl_platform(platform) { - "macintosh" { - $con configure -font {Monaco 10 normal} -highlightthickness 0 - } "windows" { $con configure -font systemfixed } @@ -467,13 +462,9 @@ proc ::tk::ConsoleBind {w} { } bind Console { eval destroy [winfo child .] - if {$tcl_platform(platform) eq "macintosh"} { - if {[catch {source [file join $tk_library console.tcl]}]} {source -rsrc console} - } else { - source [file join $tk_library console.tcl] - } + source [file join $tk_library console.tcl] } - if {$::tcl_platform(platform) eq "macintosh" || [tk windowingsystem] eq "aqua"} { + if {[tk windowingsystem] eq "aqua"} { bind Console { exit } diff --git a/library/dialog.tcl b/library/dialog.tcl index 1ec578e..504bc9e 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -45,7 +45,7 @@ proc ::tk_dialog {w title text bitmap default args} { } set windowingsystem [tk windowingsystem] - if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { option add *Dialog*background systemDialogBackgroundActive widgetDefault option add *Dialog*Button.highlightBackground \ systemDialogBackgroundActive widgetDefault @@ -71,7 +71,7 @@ proc ::tk_dialog {w title text bitmap default args} { wm transient $w [winfo toplevel [winfo parent $w]] } - if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { ::tk::unsupported::MacWindowStyle style $w moveableModal {} } elseif {$windowingsystem eq "x11"} { wm attributes $w -type dialog @@ -91,7 +91,7 @@ proc ::tk_dialog {w title text bitmap default args} { # overridden by the caller). option add *Dialog.msg.wrapLength 3i widgetDefault - if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { option add *Dialog.msg.font system widgetDefault } else { option add *Dialog.msg.font {Times 12} widgetDefault @@ -100,8 +100,7 @@ proc ::tk_dialog {w title text bitmap default args} { label $w.msg -justify left -text $text pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m if {$bitmap ne ""} { - if {($tcl_platform(platform) eq "macintosh" - || $windowingsystem eq "aqua") && ($bitmap eq "error")} { + if {$windowingsystem eq "aqua" && $bitmap eq "error"} { set bitmap "stop" } label $w.bitmap -bitmap $bitmap @@ -122,7 +121,7 @@ proc ::tk_dialog {w title text bitmap default args} { -padx 10 -pady 4 grid columnconfigure $w.bot $i # We boost the size of some Mac buttons for l&f - if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { set tmp [string tolower $but] if {$tmp eq "ok" || $tmp eq "cancel"} { grid columnconfigure $w.bot $i -minsize 90 diff --git a/library/entry.tcl b/library/entry.tcl index 93812b7..da9a865 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -203,7 +203,7 @@ bind Entry {# nothing} bind Entry {# nothing} bind Entry {# nothing} bind Entry {# nothing} -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Entry {# nothing} } diff --git a/library/listbox.tcl b/library/listbox.tcl index 9fd86e4..40fe9f7 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -176,7 +176,7 @@ bind Listbox { # The MouseWheel will typically only fire on Windows and Mac OS X. # However, someone could use the "event generate" command to produce # one on other platforms. -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Listbox { %W yview scroll [expr {- (%D)}] units } diff --git a/library/msgbox.tcl b/library/msgbox.tcl index e5a363d..301b750 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -156,7 +156,7 @@ proc ::tk::MessageBox {args} { error "bad -icon value \"$data(-icon)\": must be error, info, question, or warning" } set windowingsystem [tk windowingsystem] - if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { switch -- $data(-icon) { "error" {set data(-icon) "stop"} "warning" {set data(-icon) "caution"} @@ -263,7 +263,7 @@ proc ::tk::MessageBox {args} { wm transient $w $data(-parent) } - if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { ::tk::unsupported::MacWindowStyle style $w moveableModal {} } elseif {$windowingsystem eq "x11"} { wm attributes $w -type dialog @@ -273,7 +273,7 @@ proc ::tk::MessageBox {args} { pack $w.bot -side bottom -fill both frame $w.top -background $bg pack $w.top -side top -fill both -expand 1 - if {$windowingsystem ne "classic" && $windowingsystem ne "aqua"} { + if {$windowingsystem ne "aqua"} { $w.bot configure -relief raised -bd 1 $w.top configure -relief raised -bd 1 } @@ -283,7 +283,7 @@ proc ::tk::MessageBox {args} { # overridden by the caller). option add *Dialog.msg.wrapLength 3i widgetDefault - if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { option add *Dialog.msg.font system widgetDefault } else { option add *Dialog.msg.font {Times 14} widgetDefault @@ -292,7 +292,7 @@ proc ::tk::MessageBox {args} { label $w.msg -anchor nw -justify left -text $data(-message) \ -background $bg if {$data(-icon) ne ""} { - if {($windowingsystem eq "classic" || $windowingsystem eq "aqua") + if {($windowingsystem eq "aqua") || ([winfo depth $w] < 4) || $tk_strictMotif} { label $w.bitmap -bitmap $data(-icon) -background $bg } else { @@ -358,7 +358,7 @@ proc ::tk::MessageBox {args} { grid $w.$name -in $w.bot -row 0 -column $i -padx 3m -pady 2m -sticky ew grid columnconfigure $w.bot $i -uniform buttons # We boost the size of some Mac buttons for l&f - if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { set tmp [string tolower $name] if {$tmp eq "ok" || $tmp eq "cancel" || $tmp eq "yes" || $tmp eq "no" || $tmp eq "abort" || $tmp eq "retry" || diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index f048922..5a4d960 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -128,7 +128,7 @@ bind Scrollbar { tk::ScrollToPos %W 1 } } -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Scrollbar { tk::ScrollByUnits %W v [expr {- (%D)}] } diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 9b63e09..3fa8618 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -211,7 +211,7 @@ bind Spinbox {# nothing} bind Spinbox {# nothing} bind Spinbox {# nothing} -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Spinbox {# nothing} } diff --git a/library/text.tcl b/library/text.tcl index 3b32991..10b4424 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -275,7 +275,7 @@ bind Text {# nothing} bind Text {# nothing} bind Text {# nothing} -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Text {# nothing} } @@ -391,7 +391,7 @@ bind Text { # Macintosh only bindings: -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Text { %W configure -selectbackground systemHighlight -selectforeground systemHighlightText } @@ -452,7 +452,7 @@ set ::tk::Priv(prevPos) {} # However, someone could use the "event generate" command to produce # one on other platforms. -if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} { +if {[tk windowingsystem] eq "aqua"} { bind Text { %W yview scroll [expr {- (%D)}] units } diff --git a/library/tk.tcl b/library/tk.tcl index a09cd9c..87026f6 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -117,7 +117,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} { set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}] } - if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { + if {$windowingsystem eq "aqua"} { # Avoid the native menu bar which sits on top of everything. if {$y < 22} { set y 22 } } @@ -390,35 +390,15 @@ switch [tk windowingsystem] { event add <> event add <> } - "classic" { - event add <> - event add <> - event add <> - event add <> - event add <> - event add <> - event add <> - } } # ---------------------------------------------------------------------- # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- if {$::tk_library ne ""} { - if {[tk windowingsystem] eq "classic"} { - proc ::tk::SourceLibFile {file} { - if {[catch { - namespace eval :: \ - [list source [file join $::tk_library $file.tcl]] - }]} { - namespace eval :: [list source -rsrc $file] - } - } - } else { proc ::tk::SourceLibFile {file} { namespace eval :: [list source [file join $::tk_library $file.tcl]] } - } namespace eval ::tk { SourceLibFile button SourceLibFile entry diff --git a/tests/clrpick.test b/tests/clrpick.test index cd4907a..ec570d2 100644 --- a/tests/clrpick.test +++ b/tests/clrpick.test @@ -172,11 +172,7 @@ test clrpick-2.1 {tk_chooseColor command} \ set color #808040 test clrpick-2.2 {tk_chooseColor command} \ {nonUnixUserInteraction colorsLeftover} { - if {$tcl_platform(platform) == "macintosh"} { - set colors "32768 32768 16384" - } else { - set colors "128 128 64" - } + set colors "128 128 64" ToChooseColorByKey $parent 128 128 64 tk_chooseColor -parent $parent -title "choose $colors" } "$color" diff --git a/tests/font.test b/tests/font.test index 6abc939..94953b1 100644 --- a/tests/font.test +++ b/tests/font.test @@ -52,7 +52,6 @@ setup case $tcl_platform(platform) { unix {set fixed "fixed"} windows {set fixed "courier 12"} - macintosh {set fixed "monaco 9"} } set times [font actual {times 0} -family] diff --git a/tests/macMenu.test b/tests/macMenu.test deleted file mode 100644 index 0de0f51..0000000 --- a/tests/macMenu.test +++ /dev/null @@ -1,1547 +0,0 @@ -# This file is a Tcl script to test menus in Tk. It is -# organized in the standard fashion for Tcl tests. This -# file tests the Macintosh-specific features of the menu -# system. -# -# Copyright (c) 1995-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# All rights reserved. - -package require tcltest 2.1 -namespace import -force tcltest::configure -namespace import -force tcltest::testsDirectory -configure -testdir [file join [pwd] [file dirname [info script]]] -configure -loadfile [file join [testsDirectory] constraints.tcl] -tcltest::loadTestedCommands - -test macMenu-1.0 {TkMacUseMenuID} {macOnly} { - # Can't really test TkMacUseMenuID; it's only called on startup. -} {} - -test macMenu-2.1 {GetNewID} {macOnly} { - catch {destroy .m1} - list [catch {menu .m1} msg] $msg [destroy .m1] -} {0 .m1 {}} -test macMenu-2.2 {GetNewID - cascade menu} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m2 - list [catch {menu .m2} msg] $msg [destroy .m1] [destroy .m2] -} {0 .m2 {} {}} -test macMenu-2.3 {GetNewID - running out of ids} {macOnly} { - deleteWindows - menu .menu - for {set i 0} {$i < 230} {incr i} { - menu .m$i - .menu add cascade -label ".m$i" -menu .m$i - } - menu .breaker - list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows] -} {1 {No more menus can be allocated.} {}} - -test macMenu-3.1 {FreeID} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {destroy .m1} msg] $msg -} {0 {}} - -# No way to test running out of ids in TkpNewPlatformMenu -test macMenu-4.1 {TkpNewMenu} {macOnly} { - catch {destroy .m1} - list [catch {menu .m1} msg] $msg [catch {destroy .m1} msg2] $msg2 -} {0 .m1 0 {}} -test macMenu-4.2 {TkpNewMenu - checking for help menu when one is there} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - menu .m1 - menu .m1.help -tearoff 0 - .m1.help add command -label Test - . configure -menu .m1 - raise . - update - list [catch {menu .m2} msg] $msg [destroy .m1] [destroy .m2] [. configure -menu ""] -} {0 .m2 {} {} {}} -test macMenu-4.3 {TkpNewMenu - menubar set but different interp} {macOnly} { - catch {interp delete testinterp} - catch {destroy .m1} - interp create testinterp - load {} Tk testinterp - interp eval testinterp {raise .} - interp eval testinterp {menu .m1} - interp eval testinterp {. configure -menu .m1} - interp eval testinterp {update} - list [catch {menu .m1} msg] $msg [destroy .m1] [interp delete testinterp] -} {0 .m1 {} {}} -test macMenu-4.4 {TkpNewMenu - menubar set but new menu has different parent} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - menu .m1 -tearoff 0 - .m1 add cascade -menu .m1.help - menu .m2 - .m2 add cascade -menu .m2.help - . configure -menu .m1 - raise . - update - list [catch {menu .m2.help} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .m2] -} {0 .m2.help {} {} {}} -test macMenu-4.5 {TkpNewMenu - menubar set, same parent, not .help} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add cascade -menu .m1.help - . configure -menu .m1 - raise . - update - list [catch {menu .m1.foo} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 .m1.foo {} {}} -test macMenu-4.6 {TkpNewMenu - creating the help menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add cascade -menu .m1.help - . configure -menu .m1 - raise . - update - list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 .m1.help {} {}} - -test macMenu-5.1 {TkpDestroyMenu} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {destroy .m1} msg] $msg -} {0 {}} -test macMenu-5.2 {TkpDestroyMenu - help menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add cascade -menu .m1.help - . configure -menu .m1 - menu .m1.help - raise . - update - list [catch {destroy .m1.help} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-5.3 {TkpDestroyMenu - idle handler pending} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label test - list [catch {destroy .m1} msg] $msg -} {0 {}} -test macMenu-5.4 {TkpDestroyMenu - idle handler not pending} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label test - update idletasks - list [catch {destroy .m1} msg] $msg -} {0 {}} - -test macMenu-6.1 {SetMenuCascade} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - menu .m1 - menu .m2 - list [catch {.m2 add cascade -menu .m1} msg] $msg [destroy .m1 .m2] -} {0 {} {}} -test macMenu-6.2 {SetMenuCascade - running out of ids} {macOnly} { - deleteWindows - menu .menu - for {set i 0} {$i < 230} {incr i} { - menu .m$i - .menu add cascade -label ".m$i" -menu .m$i - } - menu .breaker - list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows] -} {1 {No more menus can be allocated.} {}} - -test macMenu-7.1 {TkpDestroyMenuEntry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" - list [catch {.m1 delete 1} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-7.2 {TkpDestroyMenuEntry - help menu} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - menu .m1.help -tearoff 0 - .m1.help add command -label "test" - . configure -menu .m1 - raise . - update - list [catch {.m1.help delete test} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} - -test macMenu-8.1 {GetEntryText} {macOnly} { - catch {destroy .m1} - list [catch {menu .m1} msg] $msg [destroy .m1] -} {0 .m1 {}} -test macMenu-8.2 {GetEntryText} {macOnly testImageType} { - catch {destroy .m1} - catch {image delete image1} - menu .m1 - image create test image1 - list [catch {.m1 add command -image image1} msg] $msg [destroy .m1] [image delete image1] -} {0 {} {} {}} -test macMenu-8.3 {GetEntryText} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -bitmap questhead} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.4 {GetEntryText} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.5 {GetEntryText} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "foo" - list [catch {.m1 add command -label "foo"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.6 {GetEntryText} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "This is a very long string. 9012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890"} \ - msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.7 {GetEntryText - elipses character} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "foo..."} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.8 {GetEntryText - false elipses character} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "foo."} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.9 {GetEntryText - false elipses character} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "foo.."} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.10 {GetEntryText - false elipses character} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "foo.b"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-8.11 {GetEntryText - false elipses character} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label "foo..b"} msg] $msg [destroy .m1] -} {0 {} {}} - - -# test macMenu-9.1 - assumes some fonts -test macMenu-9.1 {FindMarkCharacter} {macOnly} { - catch {destroy .m1} - menu .m1 -font "Helvetica 12" -tearoff 0 - .m1 add checkbutton -label test - .m1 invoke test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -# All standard fonts have "¥" defined. We can't test further. - -test macMenu-10.1 {SetMenuIndicator - cascade entry} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add cascade -label foo} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-10.2 {SetMenuIndicator - not radio or checkbutton} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label foo} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-10.3 {SetMenuIndicator - indiatorOn false} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add checkbutton -label foo -indicatoron 0} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-10.4 {SetMenuIndicator - entry not selected} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add checkbutton -label foo} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-10.5 {SetMenuIndicator - checkbutton} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo - list [catch {.m1 invoke foo} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-10.6 {SetMenuIndicator - radio button} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add radiobutton -label foo - list [catch {.m1 invoke foo} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-11.1 {SetMenuTitle} {macOnly} { - catch {destroy .m1} - catch {destroy .container} - menu .container - menu .m1 -#previous title is .m1 - .container add cascade -label "File" -menu .m1 - list [catch {. configure -menu .container} msg] $msg [. configure -menu ""] [destroy .container .m1] -} {0 {} {} {}} -test macMenu-11.2 {SetMenuTitle} {macOnly} { - menu .container - menu .m1 - . configure -menu "" -#previous title is .m1 - .container add cascade -label "F" -menu .m1 - list [catch {. configure -menu .container} msg] $msg [. configure -menu ""] [destroy .container .m1] -} {0 {} {} {}} - -test macMenu-12.1 {TkpConfigureMenuEntry} {macOnly} { - catch {destroy .m1} - . configure -menu "" - menu .m1 - .m1 add cascade -menu .m3 - list [catch {.m1 entryconfigure 1 -menu .m2} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.2 {TkpConfigureMenuEntry} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - . configure -menu "" - menu .m1 - .m1 add cascade -menu .m3 - menu .m2 - list [catch {.m1 entryconfigure 1 -menu .m2} msg] $msg [destroy .m1 .m2] -} {0 {} {}} -test macMenu-12.3 {TkpConfigureMenuEntry - running out of ids} {macOnly} { - deleteWindows - menu .menu - for {set i 0} {$i < 230} {incr i} { - menu .m$i - .menu add cascade -label ".m$i" -menu .m$i - } - menu .breaker - list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows] -} {1 {No more menus can be allocated.} {}} -test macMenu-12.4 {TkpConfigureMenuEntry - Control} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Control+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.5 {TkpConfigureMenuEntry - Ctrl} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Ctrl+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.6 {TkpConfigureMenuEntry - Shift} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Shift+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.7 {TkpConfigureMenuEntry - Option} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Opt+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.8 {TkpConfigureMenuEntry - Command} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Command+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.9 {TkpConfigureMenuEntry - Cmd} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Cmd+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.10 {TkpConfigureMenuEntry - Alt} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Alt+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.11 {TkpConfigureMenuEntry - Meta} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Meta+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.12 {TkpConfigureMenuEntry - Two modifiers} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Cmd+Shift+S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.13 {TkpConfigureMenuEntry - dash instead of plus} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -accel "Command-S"} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.14 {TkpConfigureMenuEntry - idler pending} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - list [catch {.m1 entryconfigure test -label test2} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-12.15 {TkpConfigureMenuEntry - idler not pending} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - update idletasks - list [catch {.m1 entryconfigure test -label test2} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-13.1 {ReconfigureIndividualMenu - getting rid of zero items} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.2 {ReconfigureIndividualMenu - getting rid of one item} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - update idletasks - .m1 delete test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.3 {ReconfigureIndividualMenu - getting rid of more than one} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - .m1 add command -label test2 - update idletasks - .m1 entryconfigure test2 -label "test two" - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.4 {ReconfigureIndividualMenu - separator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add separator - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.5 {ReconfigureIndividualMenu - disabled} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command - .m1 entryconfigure 1 -state disabled - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.6 {ReconfigureIndividualMenu - active} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command - .m1 entryconfigure 1 -state active - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.7 {ReconfigureIndividualMenu - checkbutton not checked} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.8 {ReconfigureIndividualMenu - checkbutton - indicator off} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label test -indicatoron 0 - .m1 invoke test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.9 {ReconfigureIndividualMenu - checkbutton on} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label test - .m1 invoke test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.10 {ReconfigureIndividualMenu - radiobutton not checked} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add radiobutton -label test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.11 {ReconfigureIndividualMenu - radiobutton - indicator off} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add radiobutton -label test -indicatoron 0 - .m1 invoke test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.12 {ReconfigureIndividualMenu - radiobutton on} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add radiobutton -label test - .m1 invoke test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.13 {ReconfigureIndividualMenu} {macOnly} { - catch {destroy .m1} - . configure -menu "" - menu .m1 - .m1 add cascade -menu .m3 - .m1 entryconfigure 1 -menu .m2 - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.14 {ReconfigureIndividualMenu} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - . configure -menu "" - menu .m1 - .m1 add cascade -menu .m3 - menu .m2 - .m1 entryconfigure 1 -menu .m2 - list [catch {update idletasks} msg] $msg [destroy .m1 .m2] -} {0 {} {}} -test macMenu-13.15 {ReconfigureIndividualMenu - accelerator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -accel "Command-S" - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.16 {ReconfigureIndividualMenu - parent is disabled} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label .m1.edit -label "Edit" -state disabled - menu .m1.edit - .m1.edit add command -label foo - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-13.17 {ReconfigureIndividualMenu - disabling parent} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label .m1.edit -label Edit - menu .m1.edit - .m1.edit add command -label foo - .m1 entryconfigure Edit -state disabled - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-14.1 {ReconfigureMacintoshMenu - normal menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label test - list [catch {update idletasks} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-14.2 {ReconfigureMacintoshMenu - apple menu} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - menu .m1.apple -tearoff 0 - .m1.apple add command -label test - . configure -menu .m1 - raise . - list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-14.3 {ReconfigureMacintoshMenu - help menu} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - menu .m1.help -tearoff 0 - .m1.help add command -label test - . configure -menu .m1 - raise . - list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-14.4 {ReconfigureMacintoshMenu - menubar} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.file -label "foo" - menu .m1.file - . configure -menu .m1 - raise . - .m1 entryconfigure foo -label "File" - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} - -test macMenu-15.1 {CompleteIdlers - no idle pending} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label test - update idletasks - list [catch {.m1 post 40 40} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-15.2 {CompleteIdlers - idle pending} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label test - list [catch {.m1 post 40 40} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-15.3 {CompleteIdlers - recursive} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.m2 -label test - menu .m1.m2 - .m1.m2 add command -label test - list [catch {.m1 post 40 40} msg] $msg [destroy .m1] -} {0 {} {}} - -#Don't know how to generate nested post menus -test macMenu-16.1 {TkpPostMenu} {macOnly} { - catch {destroy .m1} - menu .m1 -postcommand "destroy .m1" - list [catch {.m1 post 40 40} msg] $msg -} {0 {}} -test macMenu-16.2 {TkpPostMenu} {macOnly} { - catch {destroy .m1} - menu .m1 -postcommand "blork" - list [catch {.m1 post 40 40} msg] $msg [destroy .m1] -} {1 {invalid command name "blork"} {}} -# We need to write the interactive test for menu posting. - -test macMenu-17.1 {TkpMenuNewEntry - no idle pending} {macOnly} { - catch {destroy .m1} - menu .m1 - list [catch {.m1 add command -label test} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-17.2 {TkpMenuNewEntry - idle pending} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label test - list [catch {.m1 add command -label test2} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-18.1 {DrawMenuBarWhenIdle} {macOnly} { - catch {destroy .m1} - . configure -menu "" - menu .m1 - . configure -menu .m1 - list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.2 {DrawMenuBarWhenIdle - clearing old apple menu out} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - menu .m1.apple - .m1.apple add command -label test - . configure -menu .m1 - raise . - update - . configure -menu "" - raise . - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-18.3 {DrawMenuBarWhenIdle - clearing out old help menu} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - menu .m1.help - .m1.help add command -label test - . configure -menu .m1 - raise . - update - . configure -menu "" - raise . - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-18.4 {DrawMenuBarWhenIdle - menu not there} {macOnly} { - catch {destroy .m1} - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] -} {0 {} {}} -test macMenu-18.5 {DrawMenuBarWhenIdle - menu there} {macOnly} { - catch {destroy .m1} - menu .m1 - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.6 {DrawMenuBarWhenIdle - no apple menu} {macOnly} { - catch {destroy .m1} - menu .m1 - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.7 {DrawMenuBarWhenIdle - apple menu references but not there} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.8 {DrawMenuBarWhenIdle - apple menu there} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - menu .m1.apple - .m1.apple add command -label test - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.9 {DrawMenuBarWhenIdle - apple menu there; no idle handler} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - menu .m1.apple - .m1.apple add command -label test - . configure -menu .m1 - raise . - update idletasks - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.10 {DrawMenuBarWhenIdle - no help menu} {macOnly} { - catch {destroy .m1} - menu .m1 - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.11 {DrawMenuBarWhenIdle - help menu referenced but not there} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.12 {DrawMenuBarWhenIdle - help menu there} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - menu .m1.help - .m1.help add command -label test - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.13 {DrawMenuBarWhenIdle - help menu there - no idlers} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.help - menu .m1.help - .m1.help add command -label test - . configure -menu .m1 - raise . - update idletasks - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -# Can't generate no menubar clone -test macMenu-18.14 {DrawMenuBarWhenIdle - apple and help menus in tearoff menubar} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -menu .m1.apple - .m1 add cascade -menu .m1.help - menu .m1.apple - menu .m1.help - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.15 {DrawMenuBarWhenIdle - apple and help menus in non-tearoff menubar} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add cascade -menu .m1.apple - .m1 add cascade -menu .m1.help - menu .m1.apple - menu .m1.help - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.16 {DrawMenuBarWhenIdle - no apple menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.17 {DrawMenuBarWhenIdle - apple menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - . configure -menu .m1 - .m1 add cascade -menu .m1.apple - menu .m1.apple - .m1.apple add cascade -label test -menu .m1.apple.test - menu .m1.apple.test - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.18 {DrawMenuBarWhenIdle - big for loop} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - menu .m1.apple -tearoff 0 - menu .m1.help -tearoff 0 - menu .m1.foo -tearoff 0 - .m1 add cascade -menu .m1.apple - .m1 add cascade -menu .m1.help - .m1 add cascade -label Foo -menu .m1.foo - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-18.19 {DrawMenuBarWhenIdle = disabled menu} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - menu .m1.edit -tearoff 0 - .m1 add cascade -menu .m1.edit -label Edit - . configure -menu .m1 - raise . - .m1 entryconfigure Edit -state disabled - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} - -test macMenu-19.1 {RecursivelyInsertMenu} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - catch {destroy .main} - catch {destroy .t2} - toplevel .t2 -menu .main - wm geometry .t2 +0+0 - menu .main - .main add cascade -menu .m1 -label ".m1" - menu .m1 - .m1 add command -label "Test 2" - .m1 add cascade -label ".m2" -menu .m2 - menu .m2 - .m2 add command -label "Test 3" - list [catch {raise .t2} msg] $msg [destroy .t2 .main .m1 .m2] -} {0 {} {}} -test macMenu-19.2 {RecursivelyInsertMenu} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - catch {destroy .main} - catch {destroy .t2} - toplevel .t2 -menu .main - wm geometry .t2 +0+0 - menu .main - .main add cascade -menu .m1 -label ".m1" - menu .m1 - .m1 add command -label "Test 2" - .m1 add cascade -label ".m2" -menu .m2 - menu .m2 - .m2 add command -label "Test 3" - list [catch {raise .t2} msg] $msg [destroy .t2 .main .m1 .m2] -} {0 {} {}} - -test macMenu-20.1 {SetDefaultMenuBar} {macOnly} { - . configure -menu "" - raise . - list [catch {update} msg] $msg -} {0 {}} - -test macMenu-21.1 {TkpSetMainMenubar - not front window} {macOnly} { - catch {destroy .m1} - catch {destroy .t2} - toplevel .t2 - wm geometry .t2 +50+50 - menu .m1 - raise . - update - list [catch {.t2 configure -menu .m1} msg] $msg [destroy .t2] [destroy .m1] -} {0 {} {} {}} -test macMenu-21.2 {TkpSetMainMenubar - menu null} {macOnly} { - . configure -menu "" - raise . - list [catch {update} msg] $msg -} {0 {}} -test macMenu-21.3 {TkpSetMainMenubar - different interps} {macOnly} { - catch {destroy .m1} - catch {interp delete testinterp} - interp create testinterp - load {} Tk testinterp - menu .m1 - . configure -menu .m1 - raise . - update - interp eval testinterp {menu .m1} - interp eval testinterp {. configure -menu .m1} - interp eval testinterp {raise .} - list [catch {interp eval testinterp {update}} msg] $msg [interp delete testinterp] [. configure -menu ""] [destroy .m1] -} {0 {} {} {} {}} -test macMenu-21.4 {TkpSetMainMenubar - different windows} {macOnly} { - catch {destroy .m1} - catch {destroy .t2} - menu .m1 - . configure -menu .m1 - toplevel .t2 - wm geometry .t2 +50+50 - .t2 configure -menu .m1 - raise . - update - raise .t2 - list [catch {update} msg] $msg [destroy .t2] [. configure -menu ""] [destroy .m1] -} {0 {} {} {} {}} -test macMenu-21.5 {TkpSetMainMenubar - old menu was null} {macOnly} { - catch {destroy .m1} - . configure -menu "" - update - menu .m1 - . configure -menu .m1 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} -test macMenu-21.6 {TkpSetMainMenubar - old menu different} {macOnly} { - catch {destroy .m1} - catch {destroy .m2} - menu .m1 - menu .m2 - . configure -menu .m1 - raise . - update - . configure -menu .m2 - raise . - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .m2] -} {0 {} {} {} {}} -test macMenu-21.7 {TkpSetMainMenubar - child window NULL - parent window now} {macOnly} { - catch {destroy .m1} - catch {destroy .t2} - toplevel .t2 - menu .m1 - .m1 add cascade -label Foo -menu .m1.foo - menu .m1.foo - .m1.foo add command -label foo - . configure -menu .m1 - raise .t2 - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .t2] -} {0 {} {} {} {}} -test macMenu-21.8 {TkpSetMainMenubar - tearoff window} {macOnly} { - catch {destroy .t2} - toplevel .t2 -menu .t2.m1 - menu .t2.m1 - .t2.m1 add cascade -label File -menu .t2.m1.foo - menu .t2.m1.foo - .t2.m1.foo add command -label foo - raise .t2 - tk::TearOffMenu .t2.m1.foo 100 100 - list [catch {update} msg] $msg [destroy .t2] -} {0 {} {}} - -test macMenu-22.1 {TkSetWindowMenuBar} {macOnly} { -} {} - -test macMenu-23.1 {TkMacDispatchMenuEvent} {macOnly} { - # needs to be interactive. -} {} - -test macMenu-24.1 {GetMenuIndicatorGeometry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo - .m1 invoke foo - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} - -test macMenu-25.1 {GetMenuAccelGeometry - cascade entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label foo - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.2 {GetMenuAccelGeometry - no accel} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.3 {GetMenuAccelGeometry - no special chars - arbitrary string} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -accel "Test" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.4 {GetMenuAccelGeometry - Command} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Cmd+S" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.5 {GetMenuAccelGeometry - Control} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Ctrl+S" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.6 {GetMenuAccelGeometry - Shift} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Shift+S" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.7 {GetMenuAccelGeometry - Option} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Opt+S" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.8 {GetMenuAccelGeometry - Combination} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Cmd+Shift+S" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} -test macMenu-25.9 {GetMenuAccelGeometry - extra text} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Command+Delete" - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} - -test macMenu-26.1 {GetTearoffEntryGeometry} {macOnly} { - # can't call this on power mac. -} {} - -test macMenu-27.1 {GetMenuSeparatorGeometry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add separator - list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] -} {0 {}} - -test macMenu-28.1 {DrawMenuEntryIndicator - non-checkbutton} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-28.2 {DrawMenuEntryIndicator - indicator off} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo -indicatoron 0 - .m1 invoke foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-28.3 {DrawMenuEntryIndicator - not selected} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-28.4 {DrawMenuEntryIndicator - checkbutton} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo - .m1 invoke foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-28.5 {DrawMenuEntryIndicator - radiobutton} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add radiobutton -label foo - .m1 invoke foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} - -# Cannot reproduce resources missing or color allocation failing easily. -test macMenu-29.1 {DrawSICN} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Cmd+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} - -# Cannot reproduce resources missing -test macMenu-30.1 {DrawMenuEntryAccelerator - cascade entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.2 {DrawMenuEntryAccelerator - no accel string} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.3 {DrawMenuEntryAccelerator - random accel string} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.4 {DrawMenuEntryAccelerator - Command} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Cmd+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.5 {DrawMenuEntryAccelerator - Option} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Opt+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.6 {DrawMenuEntryAccelerator - Shift} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Shift+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.7 {DrawMenuEntryAccelerator - Control} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Ctrl+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} -test macMenu-30.8 {DrawMenuEntryAccelerator - combination} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -accel "Cmd+Shift+S" - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-31.1 {DrawMenuSeparator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add separator - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-32.1 {TkpDrawMenuEntryLabel} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [catch {update} msg] $msg [destroy .m1] -} {0 {} {}} - -test macMenu-33.1 {MenuDefProc - No way to test automatically.} {} {} -test macMenu-34.1 {TkMacHandleTearoffMenu - no way to test automatically} {} {} -test macMenu-35.1 {TkpInitializeMenuBindings - nothing to do} {} {} - -test macMenu-36.1 {TkpComputeMenubarGeometry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label foo - . configure -menu .m1 - list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] -} {0 {} {} {}} - -test macMenu-37.1 {DrawTearoffEntry - can't do automatically} {} {} -test macMenu-38.1 {TkMacSetHelpMenuItemCount - called at boot time} {} {} -test macMenu-39.1 {TkMacMenuClick - can't do automatically} {} {} - -test macMenu-40.1 {TkpDrawMenuEntry - gc for active and not strict motif} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -activeforeground red - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.3 {TkpDrawMenuEntry - gc for active and strict motif} {macOnly} { - catch {destroy .m1} - menu .m1 - set tk_strictMotif 1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] [set tk_strictMotif 0] -} {{} {} 0} -test macMenu-40.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 -disabledforeground blue - .m1 add command -label foo -state disabled -background red - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {macOnly} { - catch {destroy .m1} - menu .m1 -disabledforeground blue - .m1 add command -label foo -state disabled - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {macOnly} { - catch {destroy .m1} - menu .m1 -disabledforeground "" - .m1 add command -label foo -state disabled - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.7 {TkpDrawMenuEntry - gc for normal - custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -foreground red - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.8 {TkpDrawMenuEntry - gc for normal} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo -selectcolor orange - .m1 invoke 1 - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.10 {TkpDrawMenuEntry - gc for indicator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label foo - .m1 invoke 1 - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.11 {TkpDrawMenuEntry - border - custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -activebackground green - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.12 {TkpDrawMenuEntry - border} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.13 {TkpDrawMenuEntry - active border - strict motif} {macOnly} { - catch {destroy .m1} - set tk_strictMotif 1 - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] [set tk_strictMotif 0] -} {{} {} 0} -test macMenu-40.14 {TkpDrawMenuEntry - active border - custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -activeforeground yellow - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.15 {TkpDrawMenuEntry - active border} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - .m1 entryconfigure 1 -state active - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.16 {TkpDrawMenuEntry - font - custom entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo -font "Helvectica 72" - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.17 {TkpDrawMenuEntry - font} {macOnly} { - catch {destroy .m1} - menu .m1 -font "Courier 72" - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.18 {TkpDrawMenuEntry - separator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add separator - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.19 {TkpDrawMenuEntry - standard} {macOnly} { - catch {destroy .mb} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.20 {TkpDrawMenuEntry - disabled cascade item} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add cascade -label File -menu .m1.file - menu .m1.file - .m1.file add command -label foo - .m1 entryconfigure File -state disabled - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.21 {TkpDrawMenuEntry - indicator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label macMenu-40.20 - .m1 invoke 0 - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-40.22 {TkpDrawMenuEntry - indicator - hideMargin} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label macMenu-40.21 -hidemargin 1 - .m1 invoke 0 - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} - -test macMenu-41.1 {TkpComputeStandardMenuGeometry - no entries} {macOnly} { - catch {destroy .m1} - menu .m1 - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.2 {TkpComputeStandardMenuGeometry - one entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "one" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.3 {TkpComputeStandardMenuGeometry - more than one entry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "one" - .m1 add command -label "two" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.4 {TkpComputeStandardMenuGeometry - separator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add separator - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.5 {TkpComputeStandardMenuGeometry - standard label geometry} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.6 {TkpComputeStandardMenuGeometry - different font for entry} {macOnly} { - catch {destroy .m1} - menu .m1 -font "Helvetica 12" - .m1 add command -label "test" -font "Courier 12" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.7 {TkpComputeStandardMenuGeometry - second entry larger} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" - .m1 add command -label "test test" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.8 {TkpComputeStandardMenuGeometry - first entry larger} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test test" - .m1 add command -label "test" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.9 {TkpComputeStandardMenuGeometry - accelerator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" -accel "Ctrl+S" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.10 {TkpComputeStandardMenuGeometry - second accel larger} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" -accel "1" - .m1 add command -label "test" -accel "1 1" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.11 {TkpComputeStandardMenuGeometry - second accel smaller} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "test" -accel "1 1" - .m1 add command -label "test" -accel "1" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.12 {TkpComputeStandardMenuGeometry - indicator} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label test - .m1 invoke 1 - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.13 {TkpComputeStandardMenuGeometry - second indicator less or equal } {macOnly testImageType} { - catch {destroy .m1} - catch {image delete image1} - image create test image1 - menu .m1 - .m1 add checkbutton -image image1 - .m1 invoke 1 - .m1 add checkbutton -label test - .m1 invoke 2 - list [update idletasks] [destroy .m1] [image delete image1] -} {{} {} {}} -test macMenu-41.14 {TkpComputeStandardMenuGeometry - hidden margin} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add checkbutton -label macMenu-41.15 -hidemargin 1 - .m1 invoke macMenu-41.15 - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.15 {TkpComputeStandardMenuGeometry - zero sized menus} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.16 {TkpComputeStandardMenuGeometry - first column bigger} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label one - .m1 add command -label two - .m1 add command -label three -columnbreak 1 - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.17 {TkpComputeStandardMenuGeometry - second column bigger} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label one - .m1 add command -label two -columnbreak 1 - .m1 add command -label three - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.18 {TkpComputeStandardMenuGeometry - three columns} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label one - .m1 add command -label two -columnbreak 1 - .m1 add command -label three - .m1 add command -label four - .m1 add command -label five -columnbreak 1 - .m1 add command -label six - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.19 {TkpComputeStandardMenuGeometry - entry without accel long} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label "This is a long item with no accel." - .m1 add command -label foo -accel "Cmd+S" - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-41.20 {TkpComputeStandardMenuGeometry - entry with accel long} {macOnly} { - catch {destroy .m1} - menu .m1 -tearoff 0 - .m1 add command -label foo - .m1 add command -label "This is a long label with an accel." -accel "Cmd+W" - list [update idletasks] [destroy .m1] -} {{} {}} - -test macMenu-42.1 {DrawMenuEntryLabel - setting indicatorSpace} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "foo" - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-42.2 {DrawMenuEntryLabel - drawing image} {macOnly testImageType} { - catch {destroy .m1} - catch {image delete image1} - image create test image1 - menu .m1 - .m1 add command -image image1 - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] [image delete image1] -} {{} {} {}} -test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} {macOnly testImageType} { - catch {destroy .m1} - catch {eval image delete [image names]} - image create test image1 - image create test image2 - menu .m1 - .m1 add checkbutton -image image1 -selectimage image2 - .m1 invoke 1 - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] [eval image delete [image names]] -} {{} {} {}} -test macMenu-42.4 {DrawMenuEntryLabel - drawing a bitmap} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -bitmap questhead - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-42.5 {DrawMenuEntryLabel - drawing null label} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-42.6 {DrawMenuEntryLabel - drawing real label} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "This is a long label" -underline 3 - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-42.7 {DrawMenuEntryLabel - drawing disabled label} {macOnly} { - catch {destroy .m1} - menu .m1 -disabledforeground "" - .m1 add command -label "This is a long label" -state disabled - set tearoff [tk::TearOffMenu .m1] - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-42.8 {DrawMenuEntryLabel - disabled images} {macOnly testImageType} { - catch {destroy .m1} - catch {image delete image1} - image create test image1 - menu .m1 - .m1 add command -image image1 -state disabled - set tearoff [tk::TearOffMenu .m1 100 100] - list [update idletasks] [destroy .m1] [image delete image1] -} {{} {} {}} - -test macMenu-43.1 {GetMenuLabelGeometry - image} {macOnly testImageType} { - catch {destroy .m1} - catch {image delete image1} - menu .m1 - image create test image1 - .m1 add command -image image1 - list [update idletasks] [destroy .m1] [image delete image1] -} {{} {} {}} -test macMenu-43.2 {GetMenuLabelGeometry - bitmap} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -bitmap questhead - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-43.3 {GetMenuLabelGeometry - no text} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command - list [update idletasks] [destroy .m1] -} {{} {}} -test macMenu-43.4 {GetMenuLabelGeometry - text} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label "This is a test." - list [update idletasks] [destroy .m1] -} {{} {}} - -test macMenu-44.1 {DrawMenuEntryBackground} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - list [update] [destroy .m1] -} {{} {}} -test macMenu-44.2 {DrawMenuEntryBackground} {macOnly} { - catch {destroy .m1} - menu .m1 - .m1 add command -label foo - set tearoff [tk::TearOffMenu .m1 40 40] - $tearoff activate 0 - list [update] [destroy .m1] -} {{} {}} - -test macMenu-45.1 {TkpMenuInit - called at boot time} {macOnly} { -} {} - -# cleanup -deleteWindows -::tcltest::cleanupTests -return diff --git a/tests/macscrollbar.test b/tests/macscrollbar.test deleted file mode 100644 index c8cc214..0000000 --- a/tests/macscrollbar.test +++ /dev/null @@ -1,93 +0,0 @@ -# This file is a Tcl script to test out scrollbar widgets and -# the "scrollbar" command of Tk. This file only tests Macintosh -# specific features. It is organized in the standard fashion for -# Tcl tests. -# -# Copyright (c) 1996 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# All rights reserved. - -package require tcltest 2.1 -namespace import -force tcltest::configure -namespace import -force tcltest::testsDirectory -configure -testdir [file join [pwd] [file dirname [info script]]] -configure -loadfile [file join [testsDirectory] constraints.tcl] -tcltest::loadTestedCommands - -update - -# Tests for display and layout -wm geometry . 50x300 -scrollbar .s -pack .s -fill y -expand 1 -update -test macscroll-1.1 {TkpDisplayScrollbar procedure} {macOnly} { - list [.s configure -width] [.s configure -bd] -} {{-width width Width 16 16} {-borderwidth borderWidth BorderWidth 0 0}} -test macscroll-1.2 {TkpDisplayScrollbar procedure} {macOnly} { - # Exercise drawing 3D relief - pack .s -fill y -expand 1 -anchor center - .s configure -bd 4 - update - focus .s - update -} {} -test macscroll-1.3 {TkpDisplayScrollbar procedure} {macOnly} { - pack .s -fill y -expand 1 -anchor e - update - set x [.s configure -width] - pack .s -fill y -expand 1 -anchor w - update - list [.s configure -width] $x -} {{-width width Width 16 16} {-width width Width 16 16}} -test macscroll-1.4 {TkpDisplayScrollbar procedure} {macOnly} { - wm geometry . 300x50 - .s configure -bd 0 -orient horizontal - pack .s -fill x -expand 1 -anchor center - update - set x [.s configure -width] - pack .s -fill x -expand 1 -anchor n - update - set y [.s configure -width] - pack .s -fill x -expand 1 -anchor s - update - list [.s configure -width] $x $y -} {{-width width Width 16 16} {-width width Width 16 16} {-width width Width 16 16}} -test macscroll-1.5 {TkpDisplayScrollbar procedure} {macOnly} { - wm geometry . 300x16 - .s configure -bd 0 -orient horizontal - pack .s -fill x -expand 1 -anchor s - update - wm geometry . 300x15 - update - wm geometry . 300x14 - update -} {} -test macscroll-1.6 {TkpDisplayScrollbar procedure} {macOnly} { - # Check the drawing of the resize hack - wm geometry . 20x300 - wm resizable . 1 1 - .s configure -bd 0 -orient vertical - pack .s -fill y -expand 1 -anchor e - update - set x [.s identify 12 295] - wm resizable . 0 0 - update - set y [.s identify 12 295] - wm resizable . 1 1 - pack .s -fill y -expand 1 -anchor center - update - list $x $y [.s identify 12 295] -} {{} arrow2 arrow2} -test macscroll-1.7 {TkpDisplayScrollbar procedure} {macOnly} { - wm geometry . 300x300 - pack .s -fill y -expand 1 -anchor e - catch {destroy .s2} - scrollbar .s2 -orient horizontal - place .s2 -x 0 -y 284 -width 300 -} {} - -deleteWindows -# cleanup -::tcltest::cleanupTests -return diff --git a/tests/safe.test b/tests/safe.test index 10c8b29..ad5f356 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -35,9 +35,7 @@ tcltest::loadTestedCommands # The set of hidden commands is platform dependent: -if {"$tcl_platform(platform)" == "macintosh"} { - set hidden_cmds {beep bell cd clipboard echo encoding exit fconfigure file glob grab load ls menu open pwd selection send socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile toplevel wm} -} elseif {"$tcl_platform(platform)" == "windows"} { +if {"$tcl_platform(platform)" == "windows"} { set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel wm} } else { set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source toplevel wm} diff --git a/tests/text.test b/tests/text.test index bf70658..62136ca 100644 --- a/tests/text.test +++ b/tests/text.test @@ -130,9 +130,7 @@ test text-2.4 {Tk_TextCmd procedure} { list [catch {text .t2 -bd 2 -fg red} msg] $msg \ [lindex [.t2 config -bd] 4] [lindex [.t2 config -fg] 4] } {0 .t2 2 red} -if {$tcl_platform(platform) == "macintosh"} { - set relief solid -} elseif {$tcl_platform(platform) == "windows"} { +if {$tcl_platform(platform) == "windows"} { set relief flat } else { set relief raised diff --git a/tests/unixMenu.test b/tests/unixMenu.test index a43f6f5..44b1a06 100644 --- a/tests/unixMenu.test +++ b/tests/unixMenu.test @@ -1,7 +1,5 @@ # This file is a Tcl script to test menus in Tk. It is -# organized in the standard fashion for Tcl tests. This -# file tests the Macintosh-specific features of the menu -# system. +# organized in the standard fashion for Tcl tests. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. diff --git a/tests/winMenu.test b/tests/winMenu.test index f29face..456498a 100644 --- a/tests/winMenu.test +++ b/tests/winMenu.test @@ -1,7 +1,5 @@ # This file is a Tcl script to test menus in Tk. It is -# organized in the standard fashion for Tcl tests. This -# file tests the Macintosh-specific features of the menu -# system. +# organized in the standard fashion for Tcl tests. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. diff --git a/unix/Makefile.in b/unix/Makefile.in index 637f6f4..e2c0289 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1499,21 +1499,6 @@ BUILD_HTML = \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) # -# Target to create a Macintosh version of the distribution. This will -# do a normal distribution and then massage the output to prepare it -# for moving to the Mac platform. This requires a few scripts and -# programs found only in the Tcl greoup's tool workspace. -# - -macdist: dist - rm -f $(DISTDIR)/mac/tkMacProjects.sea.hqx - $(TCL_EXE) $(TOOL_DIR)/man2html.tcl $(DISTDIR)/tmp ../.. tk$(VERSION) - mv $(DISTDIR)/tmp/tk$(VERSION) $(DISTDIR)/html - rm -rf $(DISTDIR)/doc - rm -rf $(DISTDIR)/tmp - $(TCL_EXE) $(TOOL_DIR)/cvtEOL.tcl $(DISTDIR) - -# # Targets to build Solaris package of the distribution for the current # architecture. To build stream packages for both sun4 and i86pc # architectures: diff --git a/unix/README b/unix/README index cafe2c4..54bf387 100644 --- a/unix/README +++ b/unix/README @@ -18,8 +18,7 @@ changes on any UNIX-like system that approximates POSIX, BSD, or System V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To -compile for Mac OS X, see the README file in the directory ../macosx. To -compile for a classic Macintosh, see the README file in the directory ../mac. +compile for Mac OS X, see the README file in the directory ../macosx. How To Compile And Install Tk: ------------------------------ diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c index 0c460dc..331ebe3 100644 --- a/unix/tkUnix3d.c +++ b/unix/tkUnix3d.c @@ -12,7 +12,7 @@ #include -#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c index 9b84ab1..adde20d 100644 --- a/unix/tkUnixDraw.c +++ b/unix/tkUnixDraw.c @@ -12,7 +12,7 @@ #include "tkPort.h" #include "tkInt.h" -#if !defined(__WIN32__) && !defined(MAC_TCL) +#if !defined(__WIN32__) #include "tkUnixInt.h" #endif diff --git a/xlib/X11/X.h b/xlib/X11/X.h index 7755cac..bdc4f13 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -33,7 +33,7 @@ SOFTWARE. #define X_PROTOCOL 11 /* current protocol version */ #define X_PROTOCOL_REVISION 0 /* current minor version */ -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # define Cursor XCursor # define Region XRegion #endif @@ -669,7 +669,7 @@ are reserved in the protocol for errors and replies. */ #define LSBFirst 0 #define MSBFirst 1 -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Cursor # undef Region #endif diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h index 252b11d..3af3682 100644 --- a/xlib/X11/Xlib.h +++ b/xlib/X11/Xlib.h @@ -27,14 +27,9 @@ #define XlibSpecificationRelease 5 -#if !defined(MAC_TCL) && !defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) # include #endif -#ifdef MAC_TCL -# include -# define Cursor XCursor -# define Region XRegion -#endif #ifdef MAC_OSX_TK # include # define Cursor XCursor @@ -42,11 +37,7 @@ #endif /* applications should not depend on these two headers being included! */ -#ifdef MAC_TCL -#include -#else #include -#endif #ifndef X_WCHAR #ifdef X_NOT_STDC_ENV @@ -64,7 +55,7 @@ typedef unsigned long wchar_t; typedef char *XPointer; #define Bool int -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) /* Use define rather than typedef, since may need to undefine this later */ #define Status int #else @@ -1206,7 +1197,7 @@ _XFUNCPROTOBEGIN _XFUNCPROTOEND -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Cursor # undef Region #endif diff --git a/xlib/X11/Xutil.h b/xlib/X11/Xutil.h index 8534768..7348e90 100644 --- a/xlib/X11/Xutil.h +++ b/xlib/X11/Xutil.h @@ -29,7 +29,7 @@ SOFTWARE. /* You must include before including this file */ -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # define Region XRegion #endif @@ -848,7 +848,7 @@ extern void XXorRegion( _XFUNCPROTOEND -#if defined(MAC_TCL) || defined(MAC_OSX_TK) +#if defined(MAC_OSX_TK) # undef Region #endif diff --git a/xlib/X11/keysym.h b/xlib/X11/keysym.h index 027afe0..a8f1408 100644 --- a/xlib/X11/keysym.h +++ b/xlib/X11/keysym.h @@ -32,8 +32,4 @@ SOFTWARE. #define XK_LATIN4 #define XK_GREEK -#ifdef MAC_TCL -#include -#else #include -#endif diff --git a/xlib/xgc.c b/xlib/xgc.c index 083731a..c7c4739 100644 --- a/xlib/xgc.c +++ b/xlib/xgc.c @@ -13,15 +13,9 @@ #include -#if !defined(MAC_TCL) && !defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) # include #endif -#ifdef MAC_TCL -# include -# include -# define Cursor XCursor -# define Region XRegion -#endif #ifdef MAC_OSX_TK # include # include @@ -513,7 +507,7 @@ XDrawPoints(display, d, gc, points, npoints, mode) } } -#if !defined(MAC_TCL) && !defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) void XDrawSegments(display, d, gc, segments, nsegments) Display* display; diff --git a/xlib/xutil.c b/xlib/xutil.c index 23b589c..d40dbe5 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -12,13 +12,8 @@ #include #include -#ifdef MAC_TCL -# include -# include -#else -# include -# include -#endif +#include +#include /* *---------------------------------------------------------------------- -- cgit v0.12