summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 16:35:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 16:35:13 (GMT)
commit0d7a766fd66325da73b747a5692ca44d42422709 (patch)
tree79840e32eb88903176b0a05e9aaa6579ef1bdea0
parentb4f6160e2b8ad824f6bed8367ab2734603fc1cd8 (diff)
downloadtk-0d7a766fd66325da73b747a5692ca44d42422709.zip
tk-0d7a766fd66325da73b747a5692ca44d42422709.tar.gz
tk-0d7a766fd66325da73b747a5692ca44d42422709.tar.bz2
If TK_NO_DEPRECATED, report back message -padX/-padY as {}
-rw-r--r--generic/tkMessage.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index e0761a1..bfb10c2 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -21,6 +21,13 @@
* managed by this file:
*/
+#ifdef TK_NO_DEPRECATED
+# undef DEF_MESSAGE_PADX
+# undef DEF_MESSAGE_PADY
+# define DEF_MESSAGE_PADX NULL
+# define DEF_MESSAGE_PADY NULL
+#endif
+
typedef struct {
Tk_Window tkwin; /* Window that embodies the message. NULL
* means that the window has been destroyed
@@ -544,9 +551,21 @@ MessageWorldChanged(
Tk_GetFontMetrics(msgPtr->tkfont, &fm);
if (msgPtr->padX < 0) {
msgPtr->padX = fm.ascent / 2;
+#ifndef TK_NO_DEPRECATED
+ if (msgPtr->padXPtr) {
+ Tcl_DecrRefCount(msgPtr->padXPtr);
+ msgPtr->padXPtr = NULL;
+ }
+#endif
}
if (msgPtr->padY == -1) {
msgPtr->padY = fm.ascent / 4;
+#ifndef TK_NO_DEPRECATED
+ if (msgPtr->padYPtr) {
+ Tcl_DecrRefCount(msgPtr->padYPtr);
+ msgPtr->padYPtr = NULL;
+ }
+#endif
}
/*