diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-05-09 22:55:13 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-05-09 22:55:13 (GMT) |
commit | d470101c48044a8fdc3926a0aa2b350f2d8a30ce (patch) | |
tree | 91b66d07e0c4f224781f0f0ff7eb6825718cdf5c | |
parent | f3736659b6d5266a4ad7f4285bdb897a5b317c2b (diff) | |
parent | c36bb3a4ce583083ed0aac309ec563c5f0a37bdf (diff) | |
download | tk-d470101c48044a8fdc3926a0aa2b350f2d8a30ce.zip tk-d470101c48044a8fdc3926a0aa2b350f2d8a30ce.tar.gz tk-d470101c48044a8fdc3926a0aa2b350f2d8a30ce.tar.bz2 |
Since "borderWidth" are pixels, not ints, Tk_GetPixelsFromObj() should be used
-rw-r--r-- | generic/ttk/ttkClassicTheme.c | 10 | ||||
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkElements.c | 10 | ||||
-rw-r--r-- | generic/ttk/ttkSquare.c | 4 | ||||
-rw-r--r-- | win/ttkWinTheme.c | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index cff6aca..485d03b 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -114,7 +114,7 @@ static const Ttk_ElementOptionSpec ButtonBorderElementOptions[] = static void ButtonBorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -123,7 +123,7 @@ static void ButtonBorderElementSize( Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -155,7 +155,7 @@ static void ButtonBorderElementDraw( * Get option values. */ border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); @@ -279,7 +279,7 @@ static void SquareIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj,&borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); @@ -331,7 +331,7 @@ static void DiamondIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index b07d4d3..d5d161b 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -259,7 +259,7 @@ static const Ttk_ElementOptionSpec BorderElementOptions[] = { static void BorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -268,7 +268,7 @@ static void BorderElementSize( int borderWidth = 0; Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -296,7 +296,7 @@ static void BorderElementDraw( /* * Get option values. */ - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index d75bbe4..ddbd02b 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -142,7 +142,7 @@ static const Ttk_ElementOptionSpec BorderElementOptions[] = { static void BorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -150,7 +150,7 @@ static void BorderElementSize( BorderElement *bd = (BorderElement *)elementRecord; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); } @@ -167,7 +167,7 @@ static void BorderElementDraw( int borderWidth = 1, relief = TK_RELIEF_FLAT; border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); if (border && borderWidth > 0 && relief != TK_RELIEF_FLAT) { @@ -1767,7 +1767,7 @@ static void TabElementDraw( break; } - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); @@ -1857,7 +1857,7 @@ static void ClientElementDraw( Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 1; - Tcl_GetIntFromObj(NULL, ce->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_RAISED); diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index 57f4eda..0bcaa16 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -209,7 +209,7 @@ static void SquareElementSize( SquareElement *square = (SquareElement *)elementRecord; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, square->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, square->heightObj, heightPtr); @@ -232,7 +232,7 @@ static void SquareElementDraw( int borderWidth = 1, relief = TK_RELIEF_FLAT; foreground = Tk_Get3DBorderFromObj(tkwin, square->foregroundObj); - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, square->reliefObj, &relief); Tk_Fill3DRectangle(tkwin, d, foreground, diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 476daea..0e79e6c 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -858,7 +858,7 @@ static void TabElementDraw( XFillPolygon(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC), pts, 6, Convex, CoordModeOrigin); - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); |