summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authordas <das>2007-04-29 02:24:01 (GMT)
committerdas <das>2007-04-29 02:24:01 (GMT)
commit0ee713439182546f0e884ac2db7f83101456d56e (patch)
treeb6b29a677c5c6c642d97f66297edf93f269b37b6 /generic/tkEntry.c
parent7614214a0526527a62f6cc88b6560f003397c1a3 (diff)
downloadtk-0ee713439182546f0e884ac2db7f83101456d56e.zip
tk-0ee713439182546f0e884ac2db7f83101456d56e.tar.gz
tk-0ee713439182546f0e884ac2db7f83101456d56e.tar.bz2
* generic/tkCanvas.c: allow -selectforeground option to be None; add
* generic/tkCanvText.c: fallback to fgColor when selFgColor is None * generic/tkEntry.c: (new default on aqua to match native L&F). * generic/tkListbox.c: * generic/tkText.c: * generic/tkCanvas.c: add support for bypassing all of Tk's double * generic/tkEntry.c: buffered drawing into intermediate pixmaps * generic/tkFrame.c: (via TK_NO_DOUBLE_BUFFERING #define), it is * generic/tkListbox.c: unnecessary & wasteful on aqua where all * generic/tkPanedWindow.c: drawing is already double-buffered by the * generic/tkTextDisp.c: window server. (Use of this on other * unix/tkUnixScale.c: platforms would only require implementation of TkpClipDrawableToRect()).
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 60cbdcf..1a92e3a 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.35.2.3 2006/09/10 17:07:35 das Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.35.2.4 2007/04/29 02:24:02 das Exp $
*/
#include "tkInt.h"
@@ -144,7 +144,7 @@ static 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},
@@ -302,7 +302,7 @@ static 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},
@@ -1497,7 +1497,9 @@ EntryWorldChanged(instanceData)
}
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);
@@ -1635,6 +1637,7 @@ DisplayEntry(clientData)
Tcl_Release((ClientData) entryPtr);
}
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* In order to avoid screen flashes, this procedure redraws the
* textual area of the entry into off-screen memory, then copies
@@ -1644,6 +1647,9 @@ DisplayEntry(clientData)
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
@@ -1875,6 +1881,7 @@ DisplayEntry(clientData)
}
}
+#ifndef TK_NO_DOUBLE_BUFFERING
/*
* Everything's been redisplayed; now copy the pixmap onto the screen
* and free up the pixmap.
@@ -1884,6 +1891,7 @@ DisplayEntry(clientData)
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;
}