summaryrefslogtreecommitdiffstats
path: root/generic/tkMessage.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkMessage.c')
-rw-r--r--generic/tkMessage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index 05c0c66..65d5f1e 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -557,6 +557,10 @@ MessageWorldChanged(
msgPtr->textGC = gc;
Tk_GetFontMetrics(msgPtr->tkfont, &fm);
+ if (!msgPtr->padXPtr) {
+ msgPtr->padXPtr = Tcl_NewIntObj(-1);
+ Tcl_IncrRefCount(msgPtr->padXPtr);
+ }
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXPtr, &msgPtr->padX);
if (msgPtr->padX < 0) {
if (strcmp(Tcl_GetString(msgPtr->padXPtr), "-1")) {
@@ -566,6 +570,10 @@ MessageWorldChanged(
}
msgPtr->padX = fm.ascent / 2;
}
+ if (!msgPtr->padYPtr) {
+ msgPtr->padYPtr = Tcl_NewIntObj(-1);
+ Tcl_IncrRefCount(msgPtr->padYPtr);
+ }
Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYPtr, &msgPtr->padY);
if (msgPtr->padY < 0) {
if (strcmp(Tcl_GetString(msgPtr->padYPtr), "-1")) {