From b728ebf516d6d34a89c621a923e0751c024324f5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 8 Feb 2023 15:50:42 +0000 Subject: ttkEntry width is in avgchar, not in pixels, so TK_OPTION_PIXELS is nonsence here --- generic/ttk/ttkEntry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 5ba7538..66b83a2 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -189,7 +189,7 @@ static const Tk_OptionSpec EntryOptionSpecs[] = { {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand", NULL, TCL_INDEX_NONE, offsetof(Entry, entry.validateCmd), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_PIXELS, "-width", "width", "Width", + {TK_OPTION_INT, "-width", "width", "Width", DEF_ENTRY_WIDTH, offsetof(Entry, entry.widthObj), TCL_INDEX_NONE, 0,0,GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", @@ -2071,7 +2071,7 @@ typedef struct { static const Ttk_ElementOptionSpec TextareaElementOptions[] = { { "-font", TK_OPTION_FONT, offsetof(TextareaElement,fontObj), DEF_ENTRY_FONT }, - { "-width", TK_OPTION_PIXELS, + { "-width", TK_OPTION_INT, offsetof(TextareaElement,widthObj), "20" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -2089,7 +2089,7 @@ static void TextareaElementSize( (void)paddingPtr; Tk_GetFontMetrics(font, &fm); - Tk_GetPixelsFromObj(NULL, tkwin, textarea->widthObj, &prefWidth); + Tcl_GetIntFromObj(NULL, textarea->widthObj, &prefWidth); if (prefWidth <= 0) prefWidth = 1; -- cgit v0.12