summaryrefslogtreecommitdiffstats
path: root/generic/tkButton.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkButton.c')
-rw-r--r--generic/tkButton.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index cbbe880..2ec939e 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -1099,15 +1099,35 @@ ConfigureButton(
}
if (butPtr->borderWidth < 0) {
butPtr->borderWidth = 0;
+ if (butPtr->borderWidthPtr) {
+ Tcl_DecrRefCount(butPtr->borderWidthPtr);
+ }
+ butPtr->borderWidthPtr = Tcl_NewIntObj(0);
+ Tcl_IncrRefCount(butPtr->borderWidthPtr);
}
if (butPtr->highlightWidth < 0) {
butPtr->highlightWidth = 0;
+ if (butPtr->highlightWidthPtr) {
+ Tcl_DecrRefCount(butPtr->highlightWidthPtr);
+ }
+ butPtr->highlightWidthPtr = Tcl_NewIntObj(0);
+ Tcl_IncrRefCount(butPtr->highlightWidthPtr);
}
if (butPtr->padX < 0) {
butPtr->padX = 0;
+ if (butPtr->padXPtr) {
+ Tcl_DecrRefCount(butPtr->padXPtr);
+ }
+ butPtr->padXPtr = Tcl_NewIntObj(0);
+ Tcl_IncrRefCount(butPtr->padXPtr);
}
if (butPtr->padY < 0) {
butPtr->padY = 0;
+ if (butPtr->padYPtr) {
+ Tcl_DecrRefCount(butPtr->padYPtr);
+ }
+ butPtr->padYPtr = Tcl_NewIntObj(0);
+ Tcl_IncrRefCount(butPtr->padYPtr);
}
if (butPtr->type >= TYPE_CHECK_BUTTON) {
@@ -1463,6 +1483,7 @@ ButtonEventProc(
} else if (eventPtr->type == FocusIn) {
if (eventPtr->xfocus.detail != NotifyInferior) {
butPtr->flags |= GOT_FOCUS;
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth);
if (butPtr->highlightWidth > 0) {
goto redraw;
}
@@ -1470,6 +1491,7 @@ ButtonEventProc(
} else if (eventPtr->type == FocusOut) {
if (eventPtr->xfocus.detail != NotifyInferior) {
butPtr->flags &= ~GOT_FOCUS;
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth);
if (butPtr->highlightWidth > 0) {
goto redraw;
}