diff options
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r-- | generic/tkEntry.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 6f97c0c..1d9d084 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.39 2005/11/17 10:57:35 dkf Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.40 2006/09/06 22:39:28 hobbs Exp $ */ #include "tkInt.h" @@ -1602,15 +1602,14 @@ DisplayEntry( baseY = (Tk_Height(tkwin) + fm.ascent - fm.descent) / 2; /* - * On Windows and Mac, we need to hide the selection whenever we don't - * have the focus. + * Hide the selection whenever we don't have the focus, unless we + * always want to show selection. */ - -#ifdef ALWAYS_SHOW_SELECTION - showSelection = 1; -#else - showSelection = (entryPtr->flags & GOT_FOCUS); -#endif + if (TkpAlwaysShowSelection(entryPtr->tkwin)) { + showSelection = 1; + } else { + showSelection = (entryPtr->flags & GOT_FOCUS); + } /* * Draw the background in three layers. From bottom to top the layers are: @@ -2790,15 +2789,15 @@ EntryLostSelection( * On Windows and Mac systems, we want to remember the selection for the * next time the focus enters the window. On Unix, we need to clear the * selection since it is always visible. + * This is controlled by ::tk::AlwaysShowSelection. */ -#ifdef ALWAYS_SHOW_SELECTION - if ((entryPtr->selectFirst >= 0) && entryPtr->exportSelection) { + if (TkpAlwaysShowSelection(entryPtr->tkwin) + && (entryPtr->selectFirst >= 0) && entryPtr->exportSelection) { entryPtr->selectFirst = -1; entryPtr->selectLast = -1; EventuallyRedraw(entryPtr); } -#endif } /* |