diff options
author | nijtmans <nijtmans> | 2010-03-12 13:02:36 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-03-12 13:02:36 (GMT) |
commit | 36115ec36c8767cb3043dbbd1846c108ab788e8a (patch) | |
tree | bb6ddc1254faf5843d0d0c100b1065c508dd0302 /win/tkWinButton.c | |
parent | 94533b37310c2295093ae8d6f8849f99fd783c92 (diff) | |
download | tk-36115ec36c8767cb3043dbbd1846c108ab788e8a.zip tk-36115ec36c8767cb3043dbbd1846c108ab788e8a.tar.gz tk-36115ec36c8767cb3043dbbd1846c108ab788e8a.tar.bz2 |
[Bug 2956548] TkpButtonSetDefaults only initializes one button type
Fix various gcc warnings, all backported from Tk 8.6
VC6++ does not have SPI_SETKEYBOARDCUES
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r-- | win/tkWinButton.c | 59 |
1 files changed, 4 insertions, 55 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 706f2cc..4ed7574 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinButton.c,v 1.34.2.2 2009/11/02 04:52:40 mistachkin Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.34.2.3 2010/03/12 13:02:36 nijtmans Exp $ */ #define OEMRESOURCE @@ -71,7 +71,6 @@ typedef struct ThreadSpecificData { LPSTR boxesBits; /* Pointer to bitmap data. */ DWORD boxHeight; /* Height of each sub-image. */ DWORD boxWidth; /* Width of each sub-image. */ - char defWidth[TCL_INTEGER_SPACE]; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -167,40 +166,6 @@ InitBoxes(void) /* *---------------------------------------------------------------------- * - * ButtonDefaultsExitHandler -- - * - * Frees the defaults for the buttons. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -ButtonDefaultsExitHandler( - ClientData clientData) /* Points to an array of option specs, - * terminated by one with type - * TK_OPTION_END. */ -{ - Tk_OptionSpec *specPtr = (Tk_OptionSpec *)clientData; - - for ( ; specPtr->type != TK_OPTION_END; specPtr++) { - if (specPtr->internalOffset == Tk_Offset(TkButton, borderWidth)) { - if (specPtr->defValue != NULL) { - ckfree((char *) specPtr->defValue); - specPtr->defValue = NULL; - } - } - } -} - -/* - *---------------------------------------------------------------------- - * * TkpButtonSetDefaults -- * * This procedure is invoked before option tables are created for @@ -222,26 +187,10 @@ TkpButtonSetDefaults( * terminated by one with type * TK_OPTION_END. */ { - int width; - Tk_OptionSpec *savedSpecPtr = specPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - - if (tsdPtr->defWidth[0] == 0) { - width = GetSystemMetrics(SM_CXEDGE); - if (width == 0) { - width = 1; - } - sprintf(tsdPtr->defWidth, "%d", width); - } - for ( ; specPtr->type != TK_OPTION_END; specPtr++) { - if (specPtr->internalOffset == Tk_Offset(TkButton, borderWidth)) { - char *defValue = (char *) ckalloc(strlen(tsdPtr->defWidth) + 1); - strcpy(defValue, tsdPtr->defWidth); - specPtr->defValue = defValue; - } + int width = GetSystemMetrics(SM_CXEDGE); + if (width > 0) { + sprintf(tkDefButtonBorderWidth, "%d", width); } - TkCreateExitHandler(ButtonDefaultsExitHandler, (ClientData) savedSpecPtr); } /* |