diff options
-rw-r--r-- | .github/workflows/linux-build.yml | 4 | ||||
-rw-r--r-- | .github/workflows/linux-with-tcl9-build.yml | 170 | ||||
-rw-r--r-- | generic/tkEntry.c | 6 | ||||
-rw-r--r-- | generic/tkPlace.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkProgress.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkScale.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 10 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 4 | ||||
-rw-r--r-- | tests/bind.test | 9 | ||||
-rw-r--r-- | tests/place.test | 2 | ||||
-rw-r--r-- | tests/text.test | 14 | ||||
-rw-r--r-- | tests/textDisp.test | 36 | ||||
-rw-r--r-- | tests/textTag.test | 78 | ||||
-rw-r--r-- | tests/ttk/progressbar.test | 2 | ||||
-rw-r--r-- | unix/tkUnixDefault.h | 10 | ||||
-rw-r--r-- | win/tkWinDefault.h | 10 |
17 files changed, 251 insertions, 120 deletions
diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index eeb2318..72b9bb5 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | @@ -136,7 +136,7 @@ jobs: uses: actions/checkout@v3 with: repository: tcltk/tcl - ref: main + ref: tip-626 path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | diff --git a/.github/workflows/linux-with-tcl9-build.yml b/.github/workflows/linux-with-tcl9-build.yml new file mode 100644 index 0000000..74b8b4a --- /dev/null +++ b/.github/workflows/linux-with-tcl9-build.yml @@ -0,0 +1,170 @@ +name: Linux (with Tcl 8.7) +on: [push] +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v3 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure ${CFGOPT} "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + xvfb-run --auto-servernum make test-classic | tee out-classic.txt + xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 64a2b29..8b8e772 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -176,9 +176,9 @@ static const Tk_OptionSpec entryOptSpec[] = { #define DEF_SPINBOX_CMD "" -#define DEF_SPINBOX_FROM "0" -#define DEF_SPINBOX_TO "0" -#define DEF_SPINBOX_INCREMENT "1" +#define DEF_SPINBOX_FROM "0.0" +#define DEF_SPINBOX_TO "0.0" +#define DEF_SPINBOX_INCREMENT "1.0" #define DEF_SPINBOX_FORMAT "" #define DEF_SPINBOX_VALUES "" diff --git a/generic/tkPlace.c b/generic/tkPlace.c index ba1b48a..276ee13 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -93,9 +93,9 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "", offsetof(Content, relWidthPtr), offsetof(Content, relWidth), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", TCL_INDEX_NONE, + {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0.0", TCL_INDEX_NONE, offsetof(Content, relX), 0, 0, 0}, - {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", TCL_INDEX_NONE, + {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0.0", TCL_INDEX_NONE, offsetof(Content, relY), 0, 0, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, "", offsetof(Content, widthPtr), offsetof(Content, width), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 9e4780e..4519869 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1967,13 +1967,13 @@ static const Tk_OptionSpec SpinboxOptionSpecs[] = { 0,0,0 }, {TK_OPTION_DOUBLE, "-from", "from", "From", - "0", offsetof(Spinbox,spinbox.fromObj), TCL_INDEX_NONE, + "0.0", offsetof(Spinbox,spinbox.fromObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_DOUBLE, "-to", "to", "To", - "0", offsetof(Spinbox,spinbox.toObj), TCL_INDEX_NONE, + "0.0", offsetof(Spinbox,spinbox.toObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", - "1", offsetof(Spinbox,spinbox.incrementObj), TCL_INDEX_NONE, + "1.0", offsetof(Spinbox,spinbox.incrementObj), TCL_INDEX_NONE, 0,0,0 }, {TK_OPTION_STRING, "-format", "format", "Format", "", offsetof(Spinbox, spinbox.formatObj), TCL_INDEX_NONE, diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 09c94d6..89b3d90 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -66,7 +66,7 @@ static const Tk_OptionSpec ProgressbarOptionSpecs[] = DEF_PROGRESSBAR_LENGTH, offsetof(Progressbar,progress.lengthObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED }, {TK_OPTION_DOUBLE, "-maximum", "maximum", "Maximum", - "100", offsetof(Progressbar,progress.maximumObj), TCL_INDEX_NONE, + "100.0", offsetof(Progressbar,progress.maximumObj), TCL_INDEX_NONE, 0, 0, 0 }, {TK_OPTION_STRING_TABLE, "-mode", "mode", "ProgressMode", "determinate", offsetof(Progressbar,progress.modeObj), diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 9322e76..fd1777d 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -63,11 +63,11 @@ static const Tk_OptionSpec ScaleOptionSpecs[] = offsetof(Scale,scale.orient), 0, ttkOrientStrings, STYLE_CHANGED }, - {TK_OPTION_DOUBLE, "-from", "from", "From", "0", + {TK_OPTION_DOUBLE, "-from", "from", "From", "0.0", offsetof(Scale,scale.fromObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", "1.0", offsetof(Scale,scale.toObj), TCL_INDEX_NONE, 0, 0, 0}, - {TK_OPTION_DOUBLE, "-value", "value", "Value", "0", + {TK_OPTION_DOUBLE, "-value", "value", "Value", "0.0", offsetof(Scale,scale.valueObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", DEF_SCALE_LENGTH, offsetof(Scale,scale.lengthObj), TCL_INDEX_NONE, 0, 0, diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index a20d85b..e0f26cd 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -431,7 +431,7 @@ #define DEF_SCALE_ACTIVE_BG_MONO BLACK #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE -#define DEF_SCALE_BIG_INCREMENT "0" +#define DEF_SCALE_BIG_INCREMENT "0.0" #define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" @@ -439,7 +439,7 @@ #define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR NORMAL_FG #define DEF_SCALE_FG_MONO BLACK -#define DEF_SCALE_FROM "0" +#define DEF_SCALE_FROM "0.0" #define DEF_SCALE_HIGHLIGHT_BG_COLOR DEF_SCALE_BG_COLOR #define DEF_SCALE_HIGHLIGHT_BG_MONO DEF_SCALE_BG_MONO #define DEF_SCALE_HIGHLIGHT NORMAL_FG @@ -450,7 +450,7 @@ #define DEF_SCALE_RELIEF "flat" #define DEF_SCALE_REPEAT_DELAY "300" #define DEF_SCALE_REPEAT_INTERVAL "100" -#define DEF_SCALE_RESOLUTION "1" +#define DEF_SCALE_RESOLUTION "1.0" #define DEF_SCALE_TROUGH_COLOR TROUGH #define DEF_SCALE_TROUGH_MONO WHITE #define DEF_SCALE_SHOW_VALUE "1" @@ -458,8 +458,8 @@ #define DEF_SCALE_SLIDER_RELIEF "raised" #define DEF_SCALE_STATE "normal" #define DEF_SCALE_TAKE_FOCUS NULL -#define DEF_SCALE_TICK_INTERVAL "0" -#define DEF_SCALE_TO "100" +#define DEF_SCALE_TICK_INTERVAL "0.0" +#define DEF_SCALE_TO "100.0" #define DEF_SCALE_VARIABLE "" #define DEF_SCALE_WIDTH "15" diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index eb82b88..7c33a37 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -2573,9 +2573,9 @@ static Ttk_ElementOptionSpec PbarElementOptions[] = { {"-orient", TK_OPTION_STRING, offsetof(PbarElement, orientObj), "horizontal"}, {"-value", TK_OPTION_DOUBLE, - offsetof(PbarElement, valueObj), "0"}, + offsetof(PbarElement, valueObj), "0.0"}, {"-maximum", TK_OPTION_DOUBLE, - offsetof(PbarElement, maximumObj), "100"}, + offsetof(PbarElement, maximumObj), "100.0"}, {"-phase", TK_OPTION_INT, offsetof(PbarElement, phaseObj), "0"}, {"-mode", TK_OPTION_STRING, diff --git a/tests/bind.test b/tests/bind.test index 36b4126..61c0f50 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -13,9 +13,6 @@ eval tcltest::configure $argv tcltest::loadTestedCommands tk useinputmethods 0 -testConstraint failsOnWindows [expr {![info exists ::env(CI)] || [tk windowingsystem] ne "win32"}] - - toplevel .t -width 100 -height 50 wm geom .t +0+0 update idletasks @@ -2228,7 +2225,7 @@ test bind-16.46 {ExpandPercents procedure} -setup { bind all <Key> $savedBind(All) unset savedBind } -result {0 1 2} -test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87 failsOnWindows} -setup { +test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f focus -force .t.f @@ -2236,11 +2233,11 @@ test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87 } -body { bind .t.f <Key> {set x "%K"} set x none - event generate .t.f <Key> -keysym € + event generate .t.f <Key> -keysym : set x } -cleanup { destroy .t.f -} -result € +} -result : test bind-17.1 {event command} -body { event diff --git a/tests/place.test b/tests/place.test index ea230be..a9df43d 100644 --- a/tests/place.test +++ b/tests/place.test @@ -357,7 +357,7 @@ test place-9.8 {PlaceObjCmd, configure} -setup { place configure .foo } -cleanup { destroy .foo -} -result [list {-anchor {} {} nw nw} {-bordermode {} {} inside inside} {-height {} {} {} {}} {-in {} {} {} .} {-relheight {} {} {} {}} {-relwidth {} {} {} {}} {-relx {} {} 0 0.0} {-rely {} {} 0 0.0} {-width {} {} {} {}} {-x {} {} 0 0} {-y {} {} 0 0}] +} -result [list {-anchor {} {} nw nw} {-bordermode {} {} inside inside} {-height {} {} {} {}} {-in {} {} {} .} {-relheight {} {} {} {}} {-relwidth {} {} {} {}} {-relx {} {} 0.0 0.0} {-rely {} {} 0.0 0.0} {-width {} {} {} {}} {-x {} {} 0 0} {-y {} {} 0 0}] test place-9.9 {PlaceObjCmd, configure} -setup { destroy .foo } -body { diff --git a/tests/text.test b/tests/text.test index 751d90b..2b1763a 100644 --- a/tests/text.test +++ b/tests/text.test @@ -6110,7 +6110,7 @@ test text-22.250 {TextSearchCmd, backwards search all matching at start of line} } -result {1.1 1.0 1.0} test text-23.1 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6119,7 +6119,7 @@ test text-23.1 {TkTextGetTabs procedure} -setup { destroy .t } -returnCodes {error} -result {unmatched open brace in list} test text-23.2 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6128,7 +6128,7 @@ test text-23.2 {TkTextGetTabs procedure} -setup { destroy .t } -returnCodes {error} -result {bad screen distance "xyz"} test text-23.3 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6139,7 +6139,7 @@ test text-23.3 {TkTextGetTabs procedure} -setup { destroy .t } -result {100 200} test text-23.4 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6153,7 +6153,7 @@ test text-23.4 {TkTextGetTabs procedure} -setup { destroy .t } -result {100 200 300 400} test text-23.5 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6167,7 +6167,7 @@ test text-23.5 {TkTextGetTabs procedure} -setup { destroy .t } -result {105 205 305 405} test text-23.6 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" @@ -6176,7 +6176,7 @@ test text-23.6 {TkTextGetTabs procedure} -setup { destroy .t } -returnCodes {error} -result {bad tab alignment "lork": must be left, right, center, or numeric} test text-23.7 {TkTextGetTabs procedure} -setup { - text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100 + text .t -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 150 pack .t } -body { .t insert end "1\t2\t3\t4\t55.5" diff --git a/tests/textDisp.test b/tests/textDisp.test index 792fa45..dfca1e5 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -89,7 +89,7 @@ set bigAscent [font metrics $bigFont -ascent] # This is because this configuration only has ONE single font available, # making all requested fonts become actually the same font. # See constraints.tcl for more details. -testConstraint havebigFontTwiceLargerThanTextFont [expr { +testConstraint haveBigFontTwiceLargerThanTextFont [expr { [font actual $fixedFont -size] * 2 <= [font actual $bigFont -size] }] @@ -663,7 +663,7 @@ test textDisp-2.30 {LayoutDLine, tabs, running out of space in dline} { .t bbox 1.4 } [list [xchar [expr {2*8}]] [yline 1] $fixedWidth $fixedHeight] -test textDisp-3.1 {different character sizes} havebigFontTwiceLargerThanTextFont { +test textDisp-3.1 {different character sizes} haveBigFontTwiceLargerThanTextFont { .t configure -wrap word .t delete 1.0 end .t insert end "Some sample text, including both large\n" @@ -1337,7 +1337,7 @@ test textDisp-8.9 {TkTextChanged} { update list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} -test textDisp-8.10 {TkTextChanged} havebigFontTwiceLargerThanTextFont { +test textDisp-8.10 {TkTextChanged} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -1398,7 +1398,7 @@ test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { } {} test textDisp-9.1 {TkTextRedrawTag} -constraints { - havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -body { .t configure -wrap char .t delete 1.0 end @@ -1411,7 +1411,7 @@ test textDisp-9.1 {TkTextRedrawTag} -constraints { # while still testing what we want to test } -match glob -result {{2.0 2.1[78]} {2.0 2.1[78]}} test textDisp-9.2 {TkTextRedrawTag} -constraints { - havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -body { .t configure -wrap char .t delete 1.0 end @@ -1423,7 +1423,7 @@ test textDisp-9.2 {TkTextRedrawTag} -constraints { # glob matching is to have some tolerance on actually used font size # while still testing what we want to test } -match glob -result {{1.0 2.0 2.1[678]} {1.0 2.0 2.1[678]}} -test textDisp-9.3 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.3 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1434,7 +1434,7 @@ test textDisp-9.3 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} -test textDisp-9.4 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.4 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4" @@ -1446,7 +1446,7 @@ test textDisp-9.4 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20 eof}} test textDisp-9.5 {TkTextRedrawTag} -constraints { - havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -setup { .t configure -wrap char -height [expr {[.t cget -height]+10}] } -body { @@ -1462,7 +1462,7 @@ test textDisp-9.5 {TkTextRedrawTag} -constraints { .t configure -height [expr {[.t cget -height]-10}] update } -result {{2.0 2.20} {2.0 2.20 eof}} -test textDisp-9.6 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.6 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap" @@ -1473,7 +1473,7 @@ test textDisp-9.6 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { update list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0 3.20} {2.0 2.20 3.0 3.20 eof}} -test textDisp-9.7 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.7 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -1484,7 +1484,7 @@ test textDisp-9.7 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} -constraints { - havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -body { .t configure -wrap char .t delete 1.0 end @@ -1498,7 +1498,7 @@ test textDisp-9.8 {TkTextRedrawTag} -constraints { # while still testing what we want to test } -match glob -result {2.0 2.1[678]} test textDisp-9.9 {TkTextRedrawTag} -constraints { - havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -body { .t configure -wrap char .t delete 1.0 end @@ -1511,7 +1511,7 @@ test textDisp-9.9 {TkTextRedrawTag} -constraints { # glob matching is to have some tolerance on actually used font size # while still testing what we want to test } -match glob -result {2.0 2.1[678]} -test textDisp-9.10 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.10 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -1522,7 +1522,7 @@ test textDisp-9.10 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { update set tk_textRedraw } none -test textDisp-9.11 {TkTextRedrawTag} havebigFontTwiceLargerThanTextFont { +test textDisp-9.11 {TkTextRedrawTag} haveBigFontTwiceLargerThanTextFont { .t configure -wrap char .t delete 1.0 end .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" @@ -2278,7 +2278,7 @@ test textDisp-16.9 {TkTextYviewCmd procedure, "moveto" option} { test textDisp-16.10 {TkTextYviewCmd procedure, "moveto" option} { list [catch {.t yview moveto gorp} msg] $msg } {1 {expected floating-point number but got "gorp"}} -test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} havebigFontTwiceLargerThanTextFont { +test textDisp-16.11 {TkTextYviewCmd procedure, "moveto" option} haveBigFontTwiceLargerThanTextFont { # constrained because text tagged with the big font plays a role .t yview moveto 0.5 .t index @0,0 @@ -2334,7 +2334,7 @@ test textDisp-16.16 {TkTextYviewCmd procedure, "moveto" option} { } lequal [.t index @0,0] $expected } {1} -test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} havebigFontTwiceLargerThanTextFont { +test textDisp-16.17 {TkTextYviewCmd procedure, "moveto" option} haveBigFontTwiceLargerThanTextFont { # constrained because text tagged with the big font plays a role .t yview moveto .755 .t index @0,0 @@ -3384,7 +3384,7 @@ test textDisp-22.5 {TkTextCharBbox, cut-off char} { update .t bbox 15.6 } [list [xchar 6] [yline 6] $fixedWidth $fixedHeight] -test textDisp-22.6 {TkTextCharBbox, line visible but not char} havebigFontTwiceLargerThanTextFont { +test textDisp-22.6 {TkTextCharBbox, line visible but not char} haveBigFontTwiceLargerThanTextFont { wm geometry . {} update scan [wm geom .] %dx%d oriWidth oriHeight @@ -3400,7 +3400,7 @@ test textDisp-22.6 {TkTextCharBbox, line visible but not char} havebigFontTwiceL } {1} wm geom . {} update -test textDisp-22.7 {TkTextCharBbox, different character sizes} havebigFontTwiceLargerThanTextFont { +test textDisp-22.7 {TkTextCharBbox, different character sizes} haveBigFontTwiceLargerThanTextFont { .t config -wrap char .t yview 10.0 .t tag add big 12.2 12.5 diff --git a/tests/textTag.test b/tests/textTag.test index b8206d2..c2eac34 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -11,21 +11,6 @@ namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -set textWidgetFont {Courier 12} -set bigFont {Courier 24} - -# what is needed is a font that is both fixed-width and featuring a -# specific size because in some tests (that will be constrained by -# haveFontSizes), a tag applying the $bigFont will be set to some -# characters, which action has the effect of changing what character -# is under the mouse pointer, which is the purpose of the tests -testConstraint haveFontSizes [expr { - [font metrics $textWidgetFont -fixed] && - [font actual $textWidgetFont -size] == 12 && - [font metrics $bigFont -fixed] && - [font actual $bigFont -size] == 24 } -] - set fixedFont {Courier 12} set bigFont {Helvetica 24} @@ -34,7 +19,7 @@ set bigFont {Helvetica 24} # This is because this configuration only has ONE single font available, # making all requested fonts become actually the same font. # See constraints.tcl for more details. -testConstraint havebigFontTwiceLargerThanTextFont [expr { +testConstraint haveBigFontTwiceLargerThanTextFont [expr { [font actual $fixedFont -size] * 2 <= [font actual $bigFont -size] }] @@ -187,11 +172,11 @@ test textTag-1.19 {configuration options} -body { .t tag configure x -offset [lindex [.t tag configure x -offset] 3] } -returnCodes error -result {bad screen distance "100xyz"} test textTag-1.20 {tag configuration options} -body { - .t tag configure x -overstrike on + .t tag configure x -overstrike 1 .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] -} -result {on} +} -result 1 test textTag-1.21 {configuration options} -body { .t tag configure x -overstrike stupid } -cleanup { @@ -308,11 +293,11 @@ test textTag-1.33 {configuration options} -body { .t tag configure x -tabs [lindex [.t tag configure x -tabs] 3] } -returnCodes error -result {bad tab alignment "fork": must be left, right, center, or numeric} test textTag-1.34 {tag configuration options} -body { - .t tag configure x -underline no + .t tag configure x -underline 1 .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] -} -result {no} +} -result 1 test textTag-1.35 {configuration options} -body { .t tag configure x -underline stupid } -cleanup { @@ -518,11 +503,11 @@ test textTag-5.3 {TkTextTagCmd - "configure" option} -body { } -returnCodes error -result {value for "-underline" missing} test textTag-5.4 {TkTextTagCmd - "configure" option} -body { .t tag delete x - .t tag configure x -underline yes + .t tag configure x -underline 1 .t tag configure x -underline } -cleanup { .t tag delete x -} -result {-underline {} {} {} yes} +} -result {-underline {} {} {} 1} test textTag-5.4a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underlinefg lightgreen @@ -532,11 +517,11 @@ test textTag-5.4a {TkTextTagCmd - "configure" option} -body { } -result {-underlinefg {} {} {} lightgreen} test textTag-5.5 {TkTextTagCmd - "configure" option} -body { .t tag delete x - .t tag configure x -overstrike on + .t tag configure x -overstrike 1 .t tag cget x -overstrike } -cleanup { .t tag delete x -} -result {on} +} -result 1 test textTag-5.5a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrikefg lightgreen @@ -1229,8 +1214,6 @@ test textTag-14.4 {SortTags} -setup { } -result {x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29} -set curFont [.t cget -font] -set curWrap [.t cget -wrap] set c [.t bbox 2.1] set x1 [expr {[lindex $c 0] + [lindex $c 2]/2}] set y1 [expr {[lindex $c 1] + [lindex $c 3]/2}] @@ -1240,15 +1223,6 @@ set y2 [expr {[lindex $c 1] + [lindex $c 3]/2}] set c [.t bbox 4.3] set x3 [expr {[lindex $c 0] + [lindex $c 2]/2}] set y3 [expr {[lindex $c 1] + [lindex $c 3]/2}] -.t configure -font $textWidgetFont -wrap none -update -set c [.t bbox 2.1] -set x4 [expr [lindex $c 0] + [lindex $c 2]/2] -set y4 [expr [lindex $c 1] + [lindex $c 3]/2] -set c [.t bbox 3.2] -set x5 [expr [lindex $c 0] + [lindex $c 2]/2] -set y5 [expr [lindex $c 1] + [lindex $c 3]/2] -.t configure -font $curFont -wrap $curWrap test textTag-15.1 {TkTextBindProc} -setup { .t tag delete x y @@ -1383,26 +1357,24 @@ test textTag-16.1 {TkTextPickCurrent procedure} -setup { } -result {2.1 3.2 3.2 3.2 3.2 3.2 4.3} test textTag-16.2 {TkTextPickCurrent procedure} -constraints { - haveFontSizes havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -setup { .t tag delete {*}[.t tag names] wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming - .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont # update needed here to stabilize the test update - event gen .t <ButtonRelease-1> -state 0x100 -x $x4 -y $y4 - event gen .t <Motion> -x $x5 -y $y5 + event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1 + event gen .t <Motion> -x $x2 -y $y2 set x [.t index current] .t tag add big 3.0 update lappend x [.t index current] } -cleanup { .t tag delete big - .t configure -font $curFont -wrap $curWrap } -result {3.2 3.1} test textTag-16.3 {TkTextPickCurrent procedure} -setup { @@ -1462,30 +1434,26 @@ test textTag-16.4 {TkTextPickCurrent procedure} -setup { .t tag delete {*}[.t tag names] } -result {enter-a enter-b enter-c | leave-c leave-b} -test textTag-16.5 {TkTextPickCurrent procedure} -constraints { - haveCourier12 -} -setup { +test textTag-16.5 {TkTextPickCurrent procedure} -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end } wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming - .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont - event gen .t <Motion> -x $x4 -y $y4 + event gen .t <Motion> -x $x1 -y $y1 .t tag bind a <Enter> {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t <Motion> -x $x5 -y $y5 + event gen .t <Motion> -x $x2 -y $y2 .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont -wrap $curWrap } -result {3.2} test textTag-16.6 {TkTextPickCurrent procedure} -constraints { - haveFontSizes havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end @@ -1493,22 +1461,20 @@ test textTag-16.6 {TkTextPickCurrent procedure} -constraints { wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming - .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont - event gen .t <Motion> -x $x4 -y $y4 + event gen .t <Motion> -x $x1 -y $y1 .t tag bind a <Enter> {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t <Motion> -x $x5 -y $y5 + event gen .t <Motion> -x $x2 -y $y2 update .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont -wrap $curWrap } -result {3.1} test textTag-16.7 {TkTextPickCurrent procedure} -constraints { - haveFontSizes havebigFontTwiceLargerThanTextFont + haveBigFontTwiceLargerThanTextFont } -setup { foreach i {big a b c d} { .t tag remove $i 1.0 end @@ -1516,21 +1482,19 @@ test textTag-16.7 {TkTextPickCurrent procedure} -constraints { wm geometry . +200+200 ; update event generate {} <Motion> -warp 1 -x 5 -y 5 controlPointerWarpTiming - .t configure -font $textWidgetFont -wrap none } -body { .t tag configure big -font $bigFont .t tag bind a <Enter> {.t tag add big 3.0 3.2} .t tag add a 3.2 - event gen .t <Motion> -x $x4 -y $y4 + event gen .t <Motion> -x $x1 -y $y1 .t tag bind a <Leave> {.t tag add big 3.0 3.2} .t tag add a 2.1 - event gen .t <Motion> -x $x5 -y $y5 + event gen .t <Motion> -x $x2 -y $y2 update .t index current } -cleanup { .t tag delete a big - .t configure -font $curFont -wrap $curWrap } -result {3.1} diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test index 80e51ea..deae4d1 100644 --- a/tests/ttk/progressbar.test +++ b/tests/ttk/progressbar.test @@ -96,7 +96,7 @@ test progressbar-3.1 "progressbar non-core options" -setup { } -cleanup { unset res destroy .defaultpb -} -result {w black left {} {} 0 100 100 determinate horizontal 0 0.0 {}} +} -result {w black left {} {} 0 100 100.0 determinate horizontal 0 0.0 {}} test progressbar-3.2 "TIP #442 options are taken into account" -setup { set res {} diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 8d91293..c94b1a5 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -404,7 +404,7 @@ #define DEF_SCALE_ACTIVE_BG_MONO BLACK #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE -#define DEF_SCALE_BIG_INCREMENT "0" +#define DEF_SCALE_BIG_INCREMENT "0.0" #define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" @@ -412,7 +412,7 @@ #define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR BLACK #define DEF_SCALE_FG_MONO BLACK -#define DEF_SCALE_FROM "0" +#define DEF_SCALE_FROM "0.0" #define DEF_SCALE_HIGHLIGHT_BG_COLOR DEF_SCALE_BG_COLOR #define DEF_SCALE_HIGHLIGHT_BG_MONO DEF_SCALE_BG_MONO #define DEF_SCALE_HIGHLIGHT BLACK @@ -423,7 +423,7 @@ #define DEF_SCALE_RELIEF "flat" #define DEF_SCALE_REPEAT_DELAY "300" #define DEF_SCALE_REPEAT_INTERVAL "100" -#define DEF_SCALE_RESOLUTION "1" +#define DEF_SCALE_RESOLUTION "1.0" #define DEF_SCALE_TROUGH_COLOR TROUGH #define DEF_SCALE_TROUGH_MONO WHITE #define DEF_SCALE_SHOW_VALUE "1" @@ -431,8 +431,8 @@ #define DEF_SCALE_SLIDER_RELIEF "raised" #define DEF_SCALE_STATE "normal" #define DEF_SCALE_TAKE_FOCUS NULL -#define DEF_SCALE_TICK_INTERVAL "0" -#define DEF_SCALE_TO "100" +#define DEF_SCALE_TICK_INTERVAL "0.0" +#define DEF_SCALE_TO "100.0" #define DEF_SCALE_VARIABLE "" #define DEF_SCALE_WIDTH "15" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 992c7cc..dd911bd 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -406,7 +406,7 @@ #define DEF_SCALE_ACTIVE_BG_MONO BLACK #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE -#define DEF_SCALE_BIG_INCREMENT "0" +#define DEF_SCALE_BIG_INCREMENT "0.0" #define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" @@ -414,7 +414,7 @@ #define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR NORMAL_FG #define DEF_SCALE_FG_MONO BLACK -#define DEF_SCALE_FROM "0" +#define DEF_SCALE_FROM "0.0" #define DEF_SCALE_HIGHLIGHT_BG_COLOR DEF_SCALE_BG_COLOR #define DEF_SCALE_HIGHLIGHT_BG_MONO DEF_SCALE_BG_MONO #define DEF_SCALE_HIGHLIGHT HIGHLIGHT @@ -425,7 +425,7 @@ #define DEF_SCALE_RELIEF "flat" #define DEF_SCALE_REPEAT_DELAY "300" #define DEF_SCALE_REPEAT_INTERVAL "100" -#define DEF_SCALE_RESOLUTION "1" +#define DEF_SCALE_RESOLUTION "1.0" #define DEF_SCALE_TROUGH_COLOR TROUGH #define DEF_SCALE_TROUGH_MONO WHITE #define DEF_SCALE_SHOW_VALUE "1" @@ -433,8 +433,8 @@ #define DEF_SCALE_SLIDER_RELIEF "raised" #define DEF_SCALE_STATE "normal" #define DEF_SCALE_TAKE_FOCUS NULL -#define DEF_SCALE_TICK_INTERVAL "0" -#define DEF_SCALE_TO "100" +#define DEF_SCALE_TICK_INTERVAL "0.0" +#define DEF_SCALE_TO "100.0" #define DEF_SCALE_VARIABLE "" #define DEF_SCALE_WIDTH "15" |