diff options
author | hobbs <hobbs> | 2006-09-06 22:01:24 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-09-06 22:01:24 (GMT) |
commit | cb44d676da5035f163cc11087f72fcd583dc157e (patch) | |
tree | 983074bdc91b005de21970a3ec98bae0c6d5af63 /generic/tkWindow.c | |
parent | 4912d9573af7ec34498035d73747de8a7f729510 (diff) | |
download | tk-cb44d676da5035f163cc11087f72fcd583dc157e.zip tk-cb44d676da5035f163cc11087f72fcd583dc157e.tar.gz tk-cb44d676da5035f163cc11087f72fcd583dc157e.tar.bz2 |
* generic/tkEntry.c: move hard-coded ALWAYS_SHOW_SELECTION
* generic/tkInt.h: control of entry/text selection display
* generic/tkText.c: based on focus to the Tcl level,
* generic/tkTextBTree.c: controlled by ::tk::AlwaysShowSelection
* generic/tkTextDisp.c: (boolean, private). [Bug 1553691]
* generic/tkWindow.c:
* library/tk.tcl
* unix/tkUnixPort.h:
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 |