From b80a12fe1ac29d3ba04737c7cd7b698db23d38f0 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 12 Aug 2020 13:20:55 +0000 Subject: Aqua - automatically support all NSColors in the System ColorList. --- doc/colors.n | 89 ++++++++++++-------------------------------------- macosx/tkMacOSXColor.c | 31 +++++++++++++++++- macosx/tkMacOSXColor.h | 15 ++------- 3 files changed, 52 insertions(+), 83 deletions(-) diff --git a/doc/colors.n b/doc/colors.n index 847dbaa..1e938bb 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -792,23 +792,15 @@ suggested by the color name. .RS .DS systemActiveAreaFill -systemAlertActiveText systemAlertBackgroundActive systemAlertBackgroundInactive -systemAlertInactiveText systemAlternatePrimaryHighlightColor systemAppleGuideCoachmark systemBevelActiveDark systemBevelActiveLight -systemBevelButtonActiveText -systemBevelButtonInactiveText -systemBevelButtonPressedText -systemBevelButtonStickyActiveText -systemBevelButtonStickyInactiveText systemBevelInactiveDark systemBevelInactiveLight systemBlack -systemBlackText systemButtonActiveDarkHighlight systemButtonActiveDarkShadow systemButtonActiveLightHighlight @@ -828,15 +820,10 @@ systemButtonPressedDarkHighlight systemButtonPressedDarkShadow systemButtonPressedLightHighlight systemButtonPressedLightShadow -systemButtonText systemChasingArrows -systemDialogActiveText systemDialogBackgroundActive systemDialogBackgroundInactive -systemDialogInactiveText systemDocumentWindowBackground -systemDocumentWindowTitleActiveText -systemDocumentWindowTitleInactiveText systemDragHilite systemDrawerBackground systemFinderWindowBackground @@ -844,97 +831,53 @@ systemFocusHighlight systemHighlight systemHighlightAlternate systemHighlightSecondary -systemHighlightText systemIconLabelBackground systemIconLabelBackgroundSelected -systemIconLabelSelectedText -systemIconLabelText systemListViewBackground systemListViewColumnDivider systemListViewEvenRowBackground systemListViewOddRowBackground systemListViewSeparator systemListViewSortColumnBackground -systemListViewText -systemListViewWindowHeaderBackground systemMenu systemMenuActive -systemMenuActiveText systemMenuBackground systemMenuBackgroundSelected -systemMenuDisabled -systemMenuItemActiveText -systemMenuItemDisabledText -systemMenuItemSelectedText -systemMenuText -systemMetalBackground -systemModelessDialogActiveText systemModelessDialogBackgroundActive systemModelessDialogBackgroundInactive -systemModelessDialogInactiveText systemMovableModalBackground -systemMovableModalWindowTitleActiveText -systemMovableModalWindowTitleInactiveText -systemNotificationText systemNotificationWindowBackground -systemPlacardActiveText -systemPlacardBackground -systemPlacardInactiveText -systemPlacardPressedText systemPopupArrowActive systemPopupArrowInactive systemPopupArrowPressed -systemPopupButtonActiveText -systemPopupButtonInactiveText -systemPopupButtonPressedText -systemPopupLabelActiveText -systemPopupLabelInactiveText -systemPopupWindowTitleActiveText -systemPopupWindowTitleInactiveText systemPrimaryHighlightColor -systemPushButtonActiveText -systemPushButtonInactiveText -systemPushButtonPressedText -systemRootMenuActiveText -systemRootMenuDisabledText -systemRootMenuSelectedText systemScrollBarDelimiterActive systemScrollBarDelimiterInactive -systemSecondaryGroupBoxBackground systemSecondaryHighlightColor -systemSelectedTabTextColor +systemSelectedTabTextColor systemSheetBackground systemSheetBackgroundOpaque systemSheetBackgroundTransparent systemStaticAreaFill -systemSystemDetailText -systemTabFrontActiveText -systemTabFrontInactiveText -systemTabNonFrontActiveText -systemTabNonFrontInactiveText -systemTabNonFrontPressedText -systemTabPaneBackground systemToolbarBackground systemTransparent systemUtilityWindowBackgroundActive systemUtilityWindowBackgroundInactive -systemUtilityWindowTitleActiveText -systemUtilityWindowTitleInactiveText systemWhite -systemWhiteText systemWindowBody -systemWindowHeaderActiveText -systemWindowHeaderBackground -systemWindowHeaderInactiveText .DE .RE . -The group of MacOS colors below are based on Apple's "semantic" -NSColors. On OSX 10.14 (Mojave) and later these colors change value -when Dark Mode is enabled. The numbered systemWindowBackgroundColors -are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets -to provide a contrasting background. Each numbered color constrasts -with its predecessor. +Tk supports all of the NSColors in the macOS System ColorList. The +convention for naming these colors is that the Tk name is generated by +capitalizing the macOS name and adding the prefix "system". On OSX +10.14 (Mojave) and later many of these "semantic" colors will appear +differently depending on whether the NSWindow in which they are used has +the Aqua or DarkAqua appearance. The System ColorList differs between +releases of macOS and some colors, such as systemLinkColor and +systemControlAccentColor, are simulated on older systems which did not +provide them. All of the colors below are available on all supported +macOS releases, but newer systems will support additional colors. .RS .DS systemControlAccentColor @@ -948,6 +891,15 @@ systemSelectedTextColor systemSeparatorColor systemTextBackgroundColor systemTextColor +.DE +.RE +. +The numbered systemWindowBackgroundColors below +are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets +to provide a contrasting background. Each numbered color constrasts +with its predecessor. +.RS +.DS systemWindowBackgroundColor systemWindowBackgroundColor1 systemWindowBackgroundColor2 @@ -960,7 +912,6 @@ systemWindowBackgroundColor7 .RE .TP - \fBWindows\fR . On Windows, the following additional system colors are available diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 89bddb9..e65bf35 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -40,6 +40,8 @@ void initColorTable() Tcl_HashSearch search; Tcl_HashEntry *hPtr; int newPtr, index = 0; + NSColorList *systemColorList = [NSColorList colorListNamed:@"System"]; + NSString *key; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 if (@available(macOS 10.14, *)) { @@ -50,6 +52,7 @@ void initColorTable() /* * Build a hash table for looking up a color by its name. + * First add all of the static entries from tkMacOSXColor.h */ for (entry = systemColorData; entry->name != NULL; entry++) { @@ -81,6 +84,32 @@ void initColorTable() } /* + * Add all of the colors in the System ColorList. + */ + + for (key in [systemColorList allKeys]) { + int length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + char *name; + entry = ckalloc(sizeof(SystemColorDatum)); + bzero(entry, sizeof(SystemColorDatum)); + name = ckalloc(length + 1); + strcpy(name, key.UTF8String); + name[0] = toupper(name[0]); + entry->type=semantic; + entry->name = name; + entry->selector = [key retain]; + hPtr = Tcl_CreateHashEntry(&systemColors, entry->name, &newPtr); + if (newPtr == 0) { + oldEntry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); + entry->index = oldEntry->index; + [oldEntry->selector release]; + } else { + entry->index = index++; + } + Tcl_SetHashValue(hPtr, entry); + } + + /* * Build an array for looking up a color by its index. */ @@ -211,7 +240,7 @@ GetEntryFromPixel( /* *---------------------------------------------------------------------- * - * GetRGB -- + * GetRGBA -- * * Given a SystemColorDatum and a pointer to an array of 4 CGFloats, store * the associated RGBA color values in the array. In the case of the diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h index 535d15d..da62955 100644 --- a/macosx/tkMacOSXColor.h +++ b/macosx/tkMacOSXColor.h @@ -241,27 +241,16 @@ static SystemColorDatum systemColorData[] = { {"WindowBackgroundColor7", ttkBackground, 7, NULL, 0, NULL }, /* Apple's SecondaryLabelColor is the same as their LabelColor so we roll our own. */ {"SecondaryLabelColor", ttkBackground, 14, NULL, 0, NULL }, - -{"TextColor", semantic, 0, "textColor", 0, NULL }, -{"SelectedTextColor", semantic, 0, "selectedTextColor", 0, NULL }, -{"LabelColor", semantic, 0, "textColor", 0, NULL }, -{"LabelColor", semantic, 0, "labelColor", 0, NULL }, -{"ControlTextColor", semantic, 0, "controlTextColor", 0, NULL }, -{"DisabledControlTextColor", semantic, 0, "disabledControlTextColor", 0, NULL }, +/* Color to use for notebook tab labels. */ #if MAC_OS_X_VERSION_MAX_ALLOWED > 1060 {"SelectedTabTextColor", semantic, 0, "whiteColor", 0, NULL }, #else {"SelectedTabTextColor", semantic, 0, "blackColor", 0, NULL }, #endif -{"TextBackgroundColor", semantic, 0, "textBackgroundColor", 0, NULL }, -{"SelectedTextBackgroundColor", semantic, 0, "selectedTextBackgroundColor", 0, NULL }, -{"ControlAccentColor", semantic, 0, "controlAccentColor", 0, NULL }, +/* Semantic colors that we simulate on older systems which don't supoort them. */ {"LinkColor", semantic, 0, "blueColor", 0, NULL }, -{"LinkColor", semantic, 0, "linkColor", 0, NULL }, {"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL }, -{"PlaceholderTextColor", semantic, 0, "placeholderTextColor", 0, NULL }, {"SeparatorColor", semantic, 0, "grayColor", 0, NULL }, -{"SeparatorColor", semantic, 0, "separatorColor", 0, NULL }, {NULL, 0, 0, NULL, 0, NULL } }; -- cgit v0.12 From 439d2b630bdbd573b5046781faca5166ea652f56 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 12 Aug 2020 13:29:20 +0000 Subject: Remove extra whitespace. --- doc/colors.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/colors.n b/doc/colors.n index 1e938bb..3747ee8 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -854,7 +854,7 @@ systemPrimaryHighlightColor systemScrollBarDelimiterActive systemScrollBarDelimiterInactive systemSecondaryHighlightColor -systemSelectedTabTextColor +systemSelectedTabTextColor systemSheetBackground systemSheetBackgroundOpaque systemSheetBackgroundTransparent -- cgit v0.12 From 12d683ceaacf4fff94e6e25ba528c29b000fa90b Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 12 Aug 2020 15:21:52 +0000 Subject: Fix some issues with 10.6 --- macosx/tkMacOSXColor.c | 12 +++++++++++- macosx/tkMacOSXColor.h | 2 ++ macosx/tkMacOSXMenu.c | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index e65bf35..b5b0e4b 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -35,6 +35,7 @@ static CGFloat windowBackground[4] = void initColorTable() { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_InitHashTable(&systemColors, TCL_STRING_KEYS); SystemColorDatum *entry, *oldEntry; Tcl_HashSearch search; @@ -86,7 +87,7 @@ void initColorTable() /* * Add all of the colors in the System ColorList. */ - + for (key in [systemColorList allKeys]) { int length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; char *name; @@ -95,6 +96,14 @@ void initColorTable() name = ckalloc(length + 1); strcpy(name, key.UTF8String); name[0] = toupper(name[0]); + if (!strcmp(name, "WindowBackgroundColor")) { + + /* + * Avoid black windows on old systems. + */ + + continue; + } entry->type=semantic; entry->name = name; entry->selector = [key retain]; @@ -134,6 +143,7 @@ void initColorTable() hPtr = Tcl_FindHashEntry(&systemColors, "ControlAccentColor"); entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); controlAccentIndex = entry->index; + [pool drain]; } /* diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h index da62955..0ff7aee 100644 --- a/macosx/tkMacOSXColor.h +++ b/macosx/tkMacOSXColor.h @@ -248,6 +248,8 @@ static SystemColorDatum systemColorData[] = { {"SelectedTabTextColor", semantic, 0, "blackColor", 0, NULL }, #endif /* Semantic colors that we simulate on older systems which don't supoort them. */ +{"ControlAccentColor", semantic, 0, "controlAccentColor", 0, NULL }, +{"LabelColor", semantic, 0, "blackColor", 0, NULL }, {"LinkColor", semantic, 0, "blueColor", 0, NULL }, {"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL }, {"SeparatorColor", semantic, 0, "grayColor", 0, NULL }, diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 379e25c..a77ea59 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -139,6 +139,7 @@ static int ModifierCharWidth(Tk_Font tkfont); @implementation TKBackgroundLoop - (void) main { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *modeArray = [NSArray arrayWithObjects: NSEventTrackingRunLoopMode, nil]; while(1) { @@ -151,7 +152,7 @@ static int ModifierCharWidth(Tk_Font tkfont); withObject:nil waitUntilDone:true modes:modeArray]; - if (self.cancelled) { + if ([self isCancelled]) { [NSThread exit]; } @@ -161,6 +162,7 @@ static int ModifierCharWidth(Tk_Font tkfont); [NSThread sleepForTimeInterval:0.001]; } + [pool drain]; } @end -- cgit v0.12 From 34874a19507ce2fbd97192eec38717cddb43cbd5 Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 12 Aug 2020 16:16:05 +0000 Subject: Fix an issue with 10.9 --- macosx/tkMacOSXColor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index b5b0e4b..7b517e7 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -312,7 +312,8 @@ GetRGBA( case semantic: if (entry->index == controlAccentIndex && useFakeAccentColor) { #if MAC_OS_X_VERSION_MAX_ALLOWED < 101500 - color = [NSColor colorForControlTint: [NSColor currentControlTint]]; + color = [[NSColor colorForControlTint: [NSColor currentControlTint]] + colorUsingColorSpace:sRGB]; #endif } else { color = [[NSColor valueForKey:entry->selector] colorUsingColorSpace:sRGB]; -- cgit v0.12 From acf3c7b15812de591a890158d17e497bcd1a16a4 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 13 Aug 2020 16:36:47 +0000 Subject: Use the TkMacOSXInDarkMode from bug-315104a5c10 --- macosx/tkMacOSXColor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 7b517e7..b5ca43f 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -418,23 +418,24 @@ SetCGColorComponents( MODULE_SCOPE Bool TkMacOSXInDarkMode(Tk_Window tkwin) { - int result = false; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 if (@available(macOS 10.14, *)) { TkWindow *winPtr = (TkWindow*) tkwin; + NSAppearanceName name; NSView *view = nil; if (winPtr && winPtr->privatePtr) { view = TkMacOSXDrawableView(winPtr->privatePtr); } if (view) { - result = (view.effectiveAppearance == darkAqua); + name = [[view effectiveAppearance] name]; } else { - result = ([NSAppearance currentAppearance] == darkAqua); + name = [[NSAppearance currentAppearance] name]; } + return (name == NSAppearanceNameDarkAqua); } #endif - return result; + return false; } /* -- cgit v0.12 From 9e7ea957b3c08bb06ba7a98956bfc39fca90f3cb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 14 Aug 2020 06:47:57 +0000 Subject: Use "?-option" in stead of "?option" consistantly in WrongNumArgs error-messages (backported from revised_text) --- generic/tkBusy.c | 6 +++--- generic/tkFont.c | 4 ++-- generic/tkPanedWindow.c | 2 +- generic/ttk/ttkTreeview.c | 2 +- tests/busy.test | 4 ++-- tests/font.test | 10 +++++----- tests/textMark.test | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 5014eeb..8bbf764 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -819,7 +819,7 @@ Tk_BusyObjCmd( if (Tcl_GetString(objv[1])[0] == '.') { if (objc%2 == 1) { - Tcl_WrongNumArgs(interp, 1, objv, "window ?option value ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "window ?-option value ...?"); return TCL_ERROR; } return HoldBusy(busyTablePtr, interp, objv[1], objc-2, objv+2); @@ -865,7 +865,7 @@ Tk_BusyObjCmd( case BUSY_CONFIGURE: if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "window ?option? ?value ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "window ?-option? ?value ...?"); return TCL_ERROR; } busyPtr = GetBusy(interp, busyTablePtr, objv[2]); @@ -922,7 +922,7 @@ Tk_BusyObjCmd( case BUSY_HOLD: if (objc < 3 || objc%2 != 1) { - Tcl_WrongNumArgs(interp, 2, objv, "window ?option value ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value ...?"); return TCL_ERROR; } return HoldBusy(busyTablePtr, interp, objv[2], objc-3, objv+3); diff --git a/generic/tkFont.c b/generic/tkFont.c index dbc00e4..d2aa6d2 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -556,7 +556,7 @@ Tk_FontObjCmd( if (objc < 3 || n < objc) { Tcl_WrongNumArgs(interp, 2, objv, - "font ?-displayof window? ?option? ?--? ?char?"); + "font ?-displayof window? ?-option? ?--? ?char?"); return TCL_ERROR; } @@ -753,7 +753,7 @@ Tk_FontObjCmd( } if ((objc < 3) || ((objc - skip) > 4)) { Tcl_WrongNumArgs(interp, 2, objv, - "font ?-displayof window? ?option?"); + "font ?-displayof window? ?-option?"); return TCL_ERROR; } tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]); diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index f25726e..b1eb8c2 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -690,7 +690,7 @@ PanedWindowWidgetObjCmd( case PW_PANECONFIGURE: if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, - "pane ?option? ?value option value ...?"); + "pane ?-option? ?value -option value ...?"); result = TCL_ERROR; break; } diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index b484d1c..ac6107b 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -2377,7 +2377,7 @@ static int TreeviewItemCommand( TreeItem *item; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "item ?option ?value??..."); + Tcl_WrongNumArgs(interp, 2, objv, "item ?-option ?value??..."); return TCL_ERROR; } if (!(item = FindItem(interp, tv, objv[2]))) { diff --git a/tests/busy.test b/tests/busy.test index 6a1263f..c743cec 100644 --- a/tests/busy.test +++ b/tests/busy.test @@ -21,7 +21,7 @@ test busy-1.1 {Tk_BusyObjCmd} -returnCodes error -body { test busy-2.1 {tk busy hold} -returnCodes error -body { tk busy hold -} -result {wrong # args: should be "tk busy hold window ?option value ...?"} +} -result {wrong # args: should be "tk busy hold window ?-option value ...?"} test busy-2.2 {tk busy hold root window} -body { set res [tk busy hold .] update @@ -182,7 +182,7 @@ test busy-3.7 {tk busy cget unix} -setup { test busy-4.1 {tk busy configure no window} -returnCodes error -body { tk busy configure -} -result {wrong # args: should be "tk busy configure window ?option? ?value ...?"} +} -result {wrong # args: should be "tk busy configure window ?-option? ?value ...?"} test busy-4.2 {tk busy configure invalid window} -body { tk busy configure .f diff --git a/tests/font.test b/tests/font.test index 92894d1..aa7137a 100644 --- a/tests/font.test +++ b/tests/font.test @@ -114,11 +114,11 @@ test font-4.1 {font command: actual: arguments} -body { test font-4.2 {font command: actual: arguments} -body { # (objc < 3) font actual -} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"} +} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"} test font-4.3 {font command: actual: arguments} -body { # (objc - skip > 4) when skip == 0 font actual xyz abc def -} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"} +} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"} test font-4.4 {font command: actual: displayof specified, so skip to next} -body { catch {font actual xyz -displayof . -size} } -result 0 @@ -128,7 +128,7 @@ test font-4.5 {font command: actual: displayof specified, so skip to next} -body test font-4.6 {font command: actual: arguments} -body { # (objc - skip > 4) when skip == 2 font actual xyz -displayof . abc def -} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"} +} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"} test font-4.7 {font command: actual: arguments} -constraints noExceed -body { # (tkfont == NULL) font actual "\{xyz" @@ -430,11 +430,11 @@ test font-10.2 {font command: metrics: arguments} -body { test font-10.3 {font command: metrics: arguments} -body { # (objc < 3) font metrics -} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"} +} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?-option?"} test font-10.4 {font command: metrics: arguments} -body { # (objc - skip) > 4) when skip == 0 font metrics xyz abc def -} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"} +} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?-option?"} test font-10.5 {font command: metrics: arguments} -body { # (objc - skip) > 4) when skip == 2 font metrics xyz -displayof . abc diff --git a/tests/textMark.test b/tests/textMark.test index 043ff82..b4b781c 100644 --- a/tests/textMark.test +++ b/tests/textMark.test @@ -52,7 +52,7 @@ test textMark-1.4 {TkTextMarkCmd - "gravity" option} -body { } -result {right 1.4} test textMark-1.5 {TkTextMarkCmd - "gravity" option} -body { .t mark set x 1.3 - .t mark g x left + .t mark gr x left .t insert 1.3 x list [.t mark gravity x] [.t index x] } -result {left 1.3} -- cgit v0.12