From 90de1f282ce33c6f7c69e2f7d517111d6f58102d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 13 Jun 2023 15:08:32 +0000 Subject: Fix [228476b3e9]: wish can link against incorrect libtk --- unix/Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 77589ba..f082a7f 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -621,7 +621,7 @@ objs: ${OBJS} ${WISH_EXE}: $(TK_STUB_LIB_FILE) $(WISH_OBJS) $(TK_LIB_FILE) @APP_RSRC_FILE@ - ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ + ${CC} ${CFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ ${LDFLAGS} \ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE} # Resetting the LIB_RUNTIME_DIR below is required so that @@ -634,7 +634,7 @@ $(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${TK_STUB_LIB_FILE} - ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ $(WISH_LIBS) \ + ${CC} ${CFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ ${LDFLAGS} $(WISH_LIBS) \ ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) # # FIXME: This xttest rule seems to be broken in a number of ways. It should @@ -642,8 +642,8 @@ tktest-real: ${TK_STUB_LIB_FILE} # # tktest, and it is not clear where this test.o object file comes from. # # xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) ${TK_STUB_LIB_FILE} -# ${CC} ${CFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \ -# @TK_BUILD_LIB_SPEC@ ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} \ +# ${CC} ${CFLAGS} test.o tkTest.o tkSquare.o \ +# @TK_BUILD_LIB_SPEC@ ${LDFLAGS} ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} \ # $(WISH_LIBS) $(LD_SEARCH_FLAGS) -lXt -o xttest # Note, in the target below TCL_LIBRARY needs to be set or else -- cgit v0.12 From 8757c76d0e4d9a8ce41a1f2f1b0e0ac360147010 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 14 Jun 2023 16:08:42 +0000 Subject: (cherry-pick): Replaced the deprecated "trace variable" invocations with "trace add variable"; several further improvements. --- library/demos/check.tcl | 8 ++++---- library/demos/floor.tcl | 3 ++- library/demos/goldberg.tcl | 17 ++++++++--------- library/demos/pendulum.tcl | 16 ++++++++-------- tests/button.test | 38 +++++++++++++++++++------------------- tests/entry.test | 8 ++++---- tests/scale.test | 2 +- tests/spinbox.test | 8 ++++---- tests/ttk/entry.test | 2 +- tests/ttk/progressbar.test | 2 +- tests/ttk/scrollbar.test | 2 +- tests/ttk/ttk.test | 8 ++++---- 12 files changed, 57 insertions(+), 57 deletions(-) diff --git a/library/demos/check.tcl b/library/demos/check.tcl index c072096..cf21761 100644 --- a/library/demos/check.tcl +++ b/library/demos/check.tcl @@ -65,7 +65,7 @@ proc tristate_check {n1 n2 op} { set in_check 0 } -trace variable wipers w tristate_check -trace variable brakes w tristate_check -trace variable sober w tristate_check -trace variable safety w tristate_check +trace add variable wipers write tristate_check +trace add variable brakes write tristate_check +trace add variable sober write tristate_check +trace add variable safety write tristate_check diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 7d0ad3b..4831ccf 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -62,6 +62,7 @@ proc floorDisplay {w active} { $w create window 600 100 -anchor w -window $w.entry $w create text 600 100 -anchor e -text "Room: " + $w config -scrollregion [$w bbox all] } @@ -1368,4 +1369,4 @@ if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] } bind $c "unset currentRoom" set currentRoom "" -trace variable currentRoom w "roomChanged $c" +trace add variable currentRoom write "roomChanged $c" diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl index 90815fb..e71b9d2 100644 --- a/library/demos/goldberg.tcl +++ b/library/demos/goldberg.tcl @@ -113,9 +113,9 @@ proc DoDisplay {w} { DoCtrlFrame $w DoDetailFrame $w if {[tk windowingsystem] ne "aqua"} { - ttk::button $w.show -text "\u00bb" -command [list ShowCtrl $w] -width 2 + ttk::button $w.show -text "\xbb" -command [list ShowCtrl $w] -width 2 } else { - button $w.show -text "\u00bb" -command [list ShowCtrl $w] -width 2 -highlightbackground $C(bg) + button $w.show -text "\xbb" -command [list ShowCtrl $w] -width 2 -highlightbackground $C(bg) } place $w.show -in $w.c -relx 1 -rely 0 -anchor ne update @@ -153,9 +153,9 @@ proc DoCtrlFrame {w} { raise $w.details raise $w.details.cb grid rowconfigure $w.ctrl 50 -weight 1 - trace variable ::S(mode) w [list ActiveGUI $w] - trace variable ::S(details) w [list ActiveGUI $w] - trace variable ::S(speed) w [list ActiveGUI $w] + trace add variable ::S(mode) write [list ActiveGUI $w] + trace add variable ::S(details) write [list ActiveGUI $w] + trace add variable ::S(speed) write [list ActiveGUI $w] grid $w.message -in $w.ctrl -row 98 -sticky ew -pady 5 grid $w.message.e -sticky nsew @@ -185,7 +185,6 @@ proc DoDetailFrame {w} { set w2 $w.details.f ttk::frame $w2 - set bd 2 ttk::label $w2.l -textvariable S(cnt) -background white grid $w2.l - - - -sticky ew -row 0 for {set i 1} {1} {incr i} { @@ -204,10 +203,10 @@ proc DoDetailFrame {w} { proc ShowCtrl {w} { if {[winfo ismapped $w.ctrl]} { pack forget $w.ctrl - $w.show config -text "\u00bb" + $w.show config -text "\xbb" } else { pack $w.ctrl -side right -fill both -ipady 5 - $w.show config -text "\u00ab" + $w.show config -text "\xab" } } @@ -272,7 +271,7 @@ proc Go {w {who {}}} { set now [clock clicks -milliseconds] catch {after cancel $animationCallbacks(goldberg)} if {$who ne ""} { ;# Start here for debugging - set S(active) $who; + set S(active) $who set S(mode) $MGO } if {$S(mode) == -1} return ;# Debugging diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl index 9833e8f..2eef162 100644 --- a/library/demos/pendulum.tcl +++ b/library/demos/pendulum.tcl @@ -82,8 +82,8 @@ proc showPendulum {canvas {at {}} {x {}} {y {}}} { set y [expr {25 + $length*cos($angle)}] } $canvas coords rod $home 25 $x $y - $canvas coords bob \ - [expr {$x-15}] [expr {$y-15}] [expr {$x+15}] [expr {$y+15}] + $canvas coords bob [expr {$x - 15}] [expr {$y - 15}] \ + [expr {$x + 15}] [expr {$y + 15}] } showPendulum $w.c @@ -92,7 +92,7 @@ showPendulum $w.c # respect to time.) proc showPhase {canvas} { global Theta dTheta points psw psh - lappend points [expr {$Theta+$psw}] [expr {-20*$dTheta+$psh}] + lappend points [expr {$Theta + $psw}] [expr {-20*$dTheta + $psh}] if {[llength $points] > 100} { set points [lrange $points end-99 end] } @@ -127,15 +127,15 @@ bind $w.c { bind $w.c { %W coords plate 0 25 %w 25 set home [expr {%w/2}] - %W coords pivot [expr {$home-5}] 20 [expr {$home+5}] 30 + %W coords pivot [expr {$home - 5}] 20 [expr {$home + 5}] 30 } bind $w.k { set psh [expr {%h/2}] set psw [expr {%w/2}] - %W coords x_axis 2 $psh [expr {%w-2}] $psh - %W coords y_axis $psw [expr {%h-2}] $psw 2 - %W coords label_dtheta [expr {$psw-4}] 6 - %W coords label_theta [expr {%w-6}] [expr {$psh+4}] + %W coords x_axis 2 $psh [expr {%w - 2}] $psh + %W coords y_axis $psw [expr {%h - 2}] $psw 2 + %W coords label_dtheta [expr {$psw - 4}] 6 + %W coords label_theta [expr {%w - 6}] [expr {$psh + 4}] } # This procedure is the "business" part of the simulation that does diff --git a/tests/button.test b/tests/button.test index 9a69b1b..c1f2898 100644 --- a/tests/button.test +++ b/tests/button.test @@ -2910,7 +2910,7 @@ test button-3.23 {ButtonWidgetCmd procedure, "deselect" option} -body { test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body { checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 set checkvar 1 - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace .c deselect } -cleanup { destroy .c @@ -2919,7 +2919,7 @@ test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body { test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body { checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 set checkvar 1 - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace catch {.c deselect} list $errorInfo $checkvar } -cleanup { @@ -2932,7 +2932,7 @@ test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body { test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body { radiobutton .r -variable radiovar -value red set radiovar red - trace variable radiovar w bogusTrace + trace add variable radiovar write bogusTrace .r deselect } -cleanup { destroy .r @@ -2941,7 +2941,7 @@ test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body { test button-3.27 {ButtonWidgetCmd procedure, "deselect" option} -body { radiobutton .r -variable radiovar -value red set radiovar red - trace variable radiovar w bogusTrace + trace add variable radiovar write bogusTrace catch {.r deselect} list $errorInfo $radiovar } -cleanup { @@ -3070,7 +3070,7 @@ test button-3.43 {ButtonWidgetCmd procedure, "select" option} -body { test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body { radiobutton .r -variable radiovar -value red set radiovar yellow - trace variable radiovar w bogusTrace + trace add variable radiovar write bogusTrace .r select } -cleanup { destroy .r @@ -3079,7 +3079,7 @@ test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body { test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body { radiobutton .r -variable radiovar -value red set radiovar yellow - trace variable radiovar w bogusTrace + trace add variable radiovar write bogusTrace catch {.r select} list $errorInfo $radiovar } -cleanup { @@ -3131,7 +3131,7 @@ test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body { test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar xyz - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace .c toggle } -cleanup { destroy .c @@ -3140,7 +3140,7 @@ test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body { test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar xyz - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace catch {.c toggle} list $errorInfo $checkvar } -cleanup { @@ -3153,7 +3153,7 @@ test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body { test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar abc - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace .c toggle } -cleanup { trace vdelete checkvar w bogusTrace @@ -3162,7 +3162,7 @@ test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body { test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body { checkbutton .c -variable checkvar -onvalue xyz -offvalue abc set checkvar abc - trace variable checkvar w bogusTrace + trace add variable checkvar write bogusTrace catch {.c toggle} list $errorInfo $checkvar } -cleanup { @@ -3304,7 +3304,7 @@ test button-5.9 {ConfigureButton - setting selected state from variable} -setup test button-5.10 {ConfigureButton - error in setting variable} -setup { unset -nocomplain x } -body { - trace variable x w bogusTrace + trace add variable x write bogusTrace radiobutton .r -variable x } -cleanup { destroy .r @@ -3337,7 +3337,7 @@ test button-5.13 {ConfigureButton - using current value of variable} -body { test button-5.14 {ConfigureButton - variable handling} -setup { unset -nocomplain x } -body { - trace variable x w bogusTrace + trace add variable x write bogusTrace radiobutton .r -text foo -textvariable x } -cleanup { trace vdelete x w bogusTrace @@ -3346,7 +3346,7 @@ test button-5.14 {ConfigureButton - variable handling} -setup { test button-5.15 {ConfigureButton - variable handling} -setup { unset -nocomplain x } -body { - trace variable x w bogusTrace + trace add variable x write bogusTrace catch {radiobutton .r -text foo -textvariable x} return $x } -cleanup { @@ -3538,7 +3538,7 @@ test button-8.2 {TkInvokeButton procedure} -setup { set x 0 } -body { checkbutton .c -variable x - trace variable x w bogusTrace + trace add variable x write bogusTrace .c invoke } -cleanup { destroy .c @@ -3548,7 +3548,7 @@ test button-8.3 {TkInvokeButton procedure} -setup { set x 0 } -body { checkbutton .c -variable x - trace variable x w bogusTrace + trace add variable x write bogusTrace catch {.c invoke} return $x } -cleanup { @@ -3559,7 +3559,7 @@ test button-8.4 {TkInvokeButton procedure} -setup { set x 1 } -body { checkbutton .c -variable x - trace variable x w bogusTrace + trace add variable x write bogusTrace .c invoke } -cleanup { destroy .c @@ -3569,7 +3569,7 @@ test button-8.5 {TkInvokeButton procedure} -setup { set x 1 } -body { checkbutton .c -variable x - trace variable x w bogusTrace + trace add variable x write bogusTrace catch {.c invoke} return $x } -cleanup { @@ -3593,7 +3593,7 @@ test button-8.6 {TkInvokeButton procedure} -setup { test button-8.7 {TkInvokeButton procedure} -body { radiobutton .r -variable x -value red set x green - trace variable x w bogusTrace + trace add variable x write bogusTrace .r invoke } -cleanup { destroy .r @@ -3602,7 +3602,7 @@ test button-8.7 {TkInvokeButton procedure} -body { test button-8.8 {TkInvokeButton procedure} -body { radiobutton .r -variable x -value red set x green - trace variable x w bogusTrace + trace add variable x write bogusTrace catch {.r invoke} list $errorInfo $x } -cleanup { diff --git a/tests/entry.test b/tests/entry.test index ffa8ce2..c0fdfcd 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -17,7 +17,7 @@ proc scroll args { global scrollInfo set scrollInfo $args } -# For trace variable +# For trace add variable proc override args { global x set x 12345 @@ -1609,7 +1609,7 @@ test entry-5.4 {ConfigureEntry procedure, -textvariable} -setup { unset -nocomplain x entry .e } -body { - trace variable x w override + trace add variable x write override .e insert 0 "Some text" .e configure -textvariable x list $x [.e get] @@ -2336,7 +2336,7 @@ test entry-8.18 {DeleteChars procedure} -setup { test entry-9.1 {EntryValueChanged procedure} -setup { unset -nocomplain x } -body { - trace variable x w override + trace add variable x write override entry .e -textvariable x -width 0 .e insert 0 foo list $x [.e get] @@ -3534,7 +3534,7 @@ test entry-22.2 {lost namespaced textvar} -body { test entry-23.1 {error in trace proc attached to the textvariable} -setup { destroy .e } -body { - trace variable myvar w traceit + trace add variable myvar write traceit proc traceit args {error "Intentional error here!"} entry .e -textvariable myvar catch {.e insert end mystring} result1 diff --git a/tests/scale.test b/tests/scale.test index a7b0963..0f32ad4 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1091,7 +1091,7 @@ test scale-13.6 {SetScaleValue procedure} -body { .s set 50 update - trace variable y w varTrace + trace add variable y write varTrace set traceInfo empty set x untouched .s set 50 diff --git a/tests/spinbox.test b/tests/spinbox.test index 147ee52..0092918 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -17,7 +17,7 @@ proc scroll args { global scrollInfo set scrollInfo $args } -# For trace variable +# For trace add variable proc override args { global x set x 12345 @@ -1952,7 +1952,7 @@ test spinbox-5.4 {ConfigureSpinbox procedure, -textvariable} -setup { unset -nocomplain x spinbox .e } -body { - trace variable x w override + trace add variable x write override .e insert 0 "Some text" .e configure -textvariable x list $x [.e get] @@ -2628,7 +2628,7 @@ test spinbox-8.18 {DeleteChars procedure} -setup { test spinbox-9.1 {SpinboxValueChanged procedure} -setup { unset -nocomplain x } -body { - trace variable x w override + trace add variable x write override spinbox .e -textvariable x -width 0 .e insert 0 foo list $x [.e get] @@ -3850,7 +3850,7 @@ test spinbox-23.1 {selection present while disabled, bug 637828} -body { test spinbox-24.1 {error in trace proc attached to the textvariable} -setup { destroy .s } -body { - trace variable myvar w traceit + trace add variable myvar write traceit proc traceit args {error "Intentional error here!"} spinbox .s -textvariable myvar -from 1 -to 10 catch {.s set mystring} result1 diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index cfc65c7..fa53874 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -240,7 +240,7 @@ test entry-6.1 {Update linked variable in write trace} -body { } catch {destroy .e} set x "" - trace variable x w override + trace add variable x write override ttk::entry .e -textvariable x .e insert 0 "Some text" set result [list $x [.e get]] diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test index 464469e..6b82108 100644 --- a/tests/ttk/progressbar.test +++ b/tests/ttk/progressbar.test @@ -74,7 +74,7 @@ test progressbar-2.4 "step with linked variable" -body { } -result 6.0 test progressbar-2.5 "error in write trace" -body { - trace variable PB w { error "YIPES!" ;# } + trace add variable PB write { error "YIPES!" ;# } .pb step set PB ;# NOTREACHED } -cleanup { unset PB } -returnCodes error -match glob -result "*YIPES!" diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test index 27a060b..9ccae12 100644 --- a/tests/ttk/scrollbar.test +++ b/tests/ttk/scrollbar.test @@ -76,7 +76,7 @@ test scrollbar-1.3 "Change orientation" -body { # test scale-1.0 "Self-destruction" -body { - trace variable v w { destroy .s ;# } + trace add variable v write { destroy .s ;# } ttk::scale .s -variable v pack .s ; update .s set 1 ; update diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index 4af2d63..f25a852 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -29,7 +29,7 @@ proc selfdestruct {w args} { } test ttk-6.1 "Self-destructing checkbutton" -body { pack [ttk::checkbutton .sd -text "Self-destruction" -variable ::sd] - trace variable sd w [list selfdestruct .sd] + trace add variable sd write [list selfdestruct .sd] update .sd invoke } -returnCodes error @@ -41,7 +41,7 @@ test ttk-6.2 "Checkbutton self-destructed" -body { test ttk-6.4 "Destroy widget in configure" -setup { set OUCH ouch - trace variable OUCH r { kill.b } + trace add variable OUCH read { kill.b } proc kill.b {args} { destroy .b } } -cleanup { unset OUCH @@ -111,7 +111,7 @@ test ttk-construction-failure-1 "Excercise construction failure path" -setup { test ttk-construction-failure-2 "Destroy widget in constructor" -setup { set OUCH ouch - trace variable OUCH r { kill.b } + trace add variable OUCH read { kill.b } proc kill.b {args} { destroy .b } } -cleanup { unset OUCH @@ -600,7 +600,7 @@ test ttk-15.1 {Bug 3062331} -setup { } -body { set Y {} ttk::button .b -textvariable Y - trace variable Y u "destroy .b; #" + trace add variable Y unset "destroy .b; #" unset Y } -cleanup { destroy .b -- cgit v0.12