summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 0ef4bc8..0f0b475 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.43 2007/04/17 14:36:49 dkf Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.44 2007/04/23 21:15:18 das Exp $
*/
#include "tkInt.h"
@@ -135,7 +135,7 @@ static const Tk_OptionSpec entryOptSpec[] = {
0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr),
- 0, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
+ TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
{TK_OPTION_STRING, "-show", "show", "Show",
DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar),
TK_OPTION_NULL_OK, 0, 0},
@@ -281,7 +281,7 @@ static const Tk_OptionSpec sbOptSpec[] = {
0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr),
- 0, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
+ TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
0, (ClientData) stateStrings, 0},
@@ -1449,7 +1449,9 @@ EntryWorldChanged(
}
entryPtr->textGC = gc;
- gcValues.foreground = entryPtr->selFgColorPtr->pixel;
+ if (entryPtr->selFgColorPtr != NULL) {
+ gcValues.foreground = entryPtr->selFgColorPtr->pixel;
+ }
gcValues.font = Tk_FontId(entryPtr->tkfont);
mask = GCForeground | GCFont;
gc = Tk_GetGC(entryPtr->tkwin, mask, &gcValues);
@@ -1583,6 +1585,7 @@ DisplayEntry(
Tcl_Release((ClientData) entryPtr);
}
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* In order to avoid screen flashes, this function redraws the textual
* area of the entry into off-screen memory, then copies it back on-screen
@@ -1592,6 +1595,9 @@ DisplayEntry(
pixmap = Tk_GetPixmap(entryPtr->display, Tk_WindowId(tkwin),
Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
+#else
+ pixmap = Tk_WindowId(tkwin);
+#endif /* TK_NO_DOUBLE_BUFFERING */
/*
* Compute x-coordinate of the pixel just after last visible one, plus
@@ -1827,6 +1833,7 @@ DisplayEntry(
}
}
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* Everything's been redisplayed; now copy the pixmap onto the screen and
* free up the pixmap.
@@ -1836,6 +1843,7 @@ DisplayEntry(
0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin),
0, 0);
Tk_FreePixmap(entryPtr->display, pixmap);
+#endif /* TK_NO_DOUBLE_BUFFERING */
entryPtr->flags &= ~BORDER_NEEDED;
}