summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-09-06 22:39:28 (GMT)
committerhobbs <hobbs>2006-09-06 22:39:28 (GMT)
commit76db84f0e28288ac0e6da5dc33d1a97626efcf54 (patch)
tree2ba9cc0bf93a726ed5be5bd91f8d50a43b16fb71 /generic/tkWindow.c
parent94edca83e594d771323cb9f0b5a4e1e0d03d8dc5 (diff)
downloadtk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.zip
tk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.tar.gz
tk-76db84f0e28288ac0e6da5dc33d1a97626efcf54.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/tkWindow.c: controlled by ::tk::AlwaysShowSelection * library/tk.tcl: (boolean, private). [Bug 1553691] * macosx/tkMacOSXDefault.h: * unix/tkUnixDefault.h: * unix/tkUnixPort.h: * win/tkWinDefault.h:
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 324ed0c..e3c5295 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.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: tkWindow.c,v 1.75 2006/07/14 18:25:14 andreas_kupries Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.76 2006/09/06 22:39:28 hobbs Exp $
*/
#include "tkPort.h"
@@ -888,10 +888,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;
@@ -1502,6 +1511,8 @@ 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);
@@ -2652,6 +2663,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 function is invoked as an exit handler. It deletes all of the