summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 17:03:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-24 17:03:17 (GMT)
commit47107586edaa7a28b4c37d88c23bc2e5c7958fff (patch)
tree09fe8d563f3cf8e802d112b4f72301934861bf99
parente563612556b631d7c7376280434d425f6fd530a7 (diff)
parentc719f5972f41a7a73b015d4f8bca1767d0c6e4d4 (diff)
downloadtk-47107586edaa7a28b4c37d88c23bc2e5c7958fff.zip
tk-47107586edaa7a28b4c37d88c23bc2e5c7958fff.tar.gz
tk-47107586edaa7a28b4c37d88c23bc2e5c7958fff.tar.bz2
Merge 8.7
-rw-r--r--generic/tkMessage.c13
-rw-r--r--tests/message.test2
2 files changed, 10 insertions, 5 deletions
diff --git a/generic/tkMessage.c b/generic/tkMessage.c
index b720835..213f92d 100644
--- a/generic/tkMessage.c
+++ b/generic/tkMessage.c
@@ -39,7 +39,7 @@ typedef struct {
*/
char *string; /* String displayed in message. */
- int numChars; /* Number of characters in string, not
+ Tcl_Size numChars; /* Number of characters in string, not
* including terminating NULL. */
char *textVarName; /* Name of variable (malloc'ed) or NULL.
* If non-NULL, message displays the contents
@@ -86,6 +86,11 @@ typedef struct {
* scripts. Malloc'ed, but may be NULL. */
int flags; /* Various flags; see below for
* definitions. */
+ Tcl_Obj *borderWidthObj; /* Width of border. */
+ Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw
+ * around widget when it has the focus. <= 0 means don't draw a highlight. */
+ Tcl_Obj *widthObj; /* User-requested width, in pixels. 0 means
+ * compute width using aspect ratio. */
} Message;
/*
@@ -120,7 +125,7 @@ static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL,
0, TCL_INDEX_NONE, 0, "-background", 0},
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_MESSAGE_BORDER_WIDTH, TCL_INDEX_NONE,
+ DEF_MESSAGE_BORDER_WIDTH, offsetof(Message, borderWidthObj),
offsetof(Message, borderWidth), 0, 0, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor),
@@ -138,7 +143,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr),
0, 0, 0},
{TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE,
+ "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, offsetof(Message, highlightWidthObj),
offsetof(Message, highlightWidth), 0, 0, 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), TK_OPTION_ENUM_VAR, 0, 0},
@@ -159,7 +164,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_MESSAGE_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Message, textVarName),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-width", "width", "Width",
- DEF_MESSAGE_WIDTH, TCL_INDEX_NONE, offsetof(Message, width), 0, 0 ,0},
+ DEF_MESSAGE_WIDTH, offsetof(Message, widthObj), offsetof(Message, width), 0, 0 ,0},
{TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0}
};
diff --git a/tests/message.test b/tests/message.test
index 37e81b0..9018fc2 100644
--- a/tests/message.test
+++ b/tests/message.test
@@ -121,7 +121,7 @@ test message-1.11 {configuration option: "borderwidth"} -setup {
.m cget -borderwidth
} -cleanup {
destroy .m
-} -result 1
+} -result 1.3
test message-1.12 {configuration option: "borderwidth"} -setup {
message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold}
pack .m