diff options
author | das <das> | 2007-04-23 21:15:17 (GMT) |
---|---|---|
committer | das <das> | 2007-04-23 21:15:17 (GMT) |
commit | eed9e6e51c9b315cca0fab5242fb5d5ed79f1d92 (patch) | |
tree | 32076caa36b64498e5a51239d238793d593cfd09 /generic/tkEntry.c | |
parent | b5c021fb2226984ca793d193dd65e007f6780ea4 (diff) | |
download | tk-eed9e6e51c9b315cca0fab5242fb5d5ed79f1d92.zip tk-eed9e6e51c9b315cca0fab5242fb5d5ed79f1d92.tar.gz tk-eed9e6e51c9b315cca0fab5242fb5d5ed79f1d92.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
* generic/ttk/ttkWidget.c: platforms would only require implementation
* unix/tkUnixScale.c: of TkpClipDrawableToRect()).
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r-- | generic/tkEntry.c | 16 |
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; } |