summaryrefslogtreecommitdiffstats
path: root/generic/tkButton.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkButton.c')
-rw-r--r--generic/tkButton.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index d129bca..9d033e4 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -1097,17 +1097,45 @@ ConfigureButton(
} else {
Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->normalBorder);
}
+ if (butPtr->wrapLength < 0) {
+ butPtr->wrapLength = 0;
+ if (butPtr->wrapLengthPtr) {
+ Tcl_DecrRefCount(butPtr->wrapLengthPtr);
+ }
+ butPtr->wrapLengthPtr = Tcl_NewIntObj(0);
+ Tcl_IncrRefCount(butPtr->wrapLengthPtr);
+ }
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 +1491,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 +1499,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;
}