diff options
Diffstat (limited to 'generic/tkCmds.c')
-rw-r--r-- | generic/tkCmds.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/generic/tkCmds.c b/generic/tkCmds.c index e1cac65..28da6e4 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCmds.c,v 1.29 2002/08/05 04:30:38 dgp Exp $ + * RCS: @(#) $Id: tkCmds.c,v 1.30 2002/08/31 06:12:20 das Exp $ */ #include "tkPort.h" @@ -22,6 +22,8 @@ #include "tkWinInt.h" #elif defined(MAC_TCL) #include "tkMacInt.h" +#elif defined(MAC_OSX_TK) +#include "tkMacOSXInt.h" #else #include "tkUnixInt.h" #endif @@ -619,10 +621,11 @@ Tk_TkObjCmd(clientData, interp, objc, objv) Tk_Window tkwin; static CONST char *optionStrings[] = { "appname", "caret", "scaling", "useinputmethods", - NULL + "windowingsystem", NULL }; enum options { - TK_APPNAME, TK_CARET, TK_SCALING, TK_USE_IM + TK_APPNAME, TK_CARET, TK_SCALING, TK_USE_IM, + TK_WINDOWINGSYSTEM }; tkwin = (Tk_Window) clientData; @@ -809,6 +812,25 @@ Tk_TkObjCmd(clientData, interp, objc, objv) (int) (dispPtr->flags & TK_DISPLAY_USE_IM)); break; } + case TK_WINDOWINGSYSTEM: { + CONST char *windowingsystem; + + if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, NULL); + return TCL_ERROR; + } + #if defined(__WIN32__) || defined(_WIN32) + windowingsystem = "win32"; + #elif defined(MAC_TCL) + windowingsystem = "classic"; + #elif defined(MAC_OSX_TK) + windowingsystem = "aqua"; + #else + windowingsystem = "x11"; + #endif + Tcl_SetStringObj(Tcl_GetObjResult(interp), windowingsystem, -1); + break; + } } return TCL_OK; } |