diff options
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r-- | generic/tkWindow.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 266ebeb..bf6676b 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.56.2.10 2006/07/14 18:24:09 andreas_kupries Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.56.2.11 2006/09/06 22:01:26 hobbs Exp $ */ #include "tkPort.h" @@ -902,10 +902,19 @@ TkCreateMainWindow(interp, screenName, baseName) mainPtr->optionRootPtr = NULL; Tcl_InitHashTable(&mainPtr->imageTable, TCL_STRING_KEYS); mainPtr->strictMotif = 0; + mainPtr->alwaysShowSelection = 0; if (Tcl_LinkVar(interp, "tk_strictMotif", (char *) &mainPtr->strictMotif, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } + if (Tcl_CreateNamespace(interp, "::tk", NULL, NULL) == NULL) { + Tcl_ResetResult(interp); + } + if (Tcl_LinkVar(interp, "::tk::AlwaysShowSelection", + (char *) &mainPtr->alwaysShowSelection, + TCL_LINK_BOOLEAN) != TCL_OK) { + Tcl_ResetResult(interp); + } mainPtr->nextPtr = tsdPtr->mainWindowList; tsdPtr->mainWindowList = mainPtr; winPtr->mainPtr = mainPtr; @@ -1529,6 +1538,7 @@ Tk_DestroyWindow(tkwin) TkDeadAppCmd, (ClientData) NULL, (void (*) _ANSI_ARGS_((ClientData))) NULL); Tcl_UnlinkVar(winPtr->mainPtr->interp, "tk_strictMotif"); + Tcl_UnlinkVar(winPtr->mainPtr->interp, "::tk::AlwaysShowSelection"); } Tcl_DeleteHashTable(&winPtr->mainPtr->nameTable); @@ -2690,6 +2700,34 @@ Tk_GetNumMainWindows() /* *---------------------------------------------------------------------- * + * TkpAlwaysShowSelection -- + * + * Indicates whether text/entry widgets should always display + * their selection, regardless of window focus. + * + * Results: + * The return value is 1 if always showing the selection has been + * requested for tkwin's application by setting the + * ::tk::AlwaysShowSelection variable in its interpreter to a true value. + * 0 is returned if it has a false value. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TkpAlwaysShowSelection(tkwin) + Tk_Window tkwin; /* Window whose application is + * to be checked. */ +{ + return ((TkWindow *) tkwin)->mainPtr->alwaysShowSelection; +} + +/* + *---------------------------------------------------------------------- + * * DeleteWindowsExitProc -- * * This procedure is invoked as an exit handler. It deletes all |