From 61f96818868debd9189fd8a75532beca3a578a6b Mon Sep 17 00:00:00 2001 From: sbron Date: Thu, 16 Mar 2023 21:16:03 +0000 Subject: Update the description of the menu entry index of the form @index to reflect how it actually works. --- doc/menu.n | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/menu.n b/doc/menu.n index ed0d33d..5f08486 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -339,13 +339,12 @@ menu. In most cases the specification of \fBnone\fR causes nothing to happen in the widget command. This form may not be abbreviated. .TP 12 -\fB@\fInumber\fR +\fB@\fIx\fB,\fIy\fR . -In this form, \fInumber\fR is treated as a y-coordinate in the -menu's window; the entry closest to that y-coordinate is used. -For example, -.QW \fB@0\fR -indicates the top-most entry in the window. +Indicates the entry that covers the point in the menu's window specified +by \fIx\fR and \fIy\fR (in pixel coordinates). +If no entry covers that point, then this form is equivalent to \fBnone\fR. +If only a single number is specified, it is treated as the y-coordinate. .TP 12 \fInumber\fR . -- cgit v0.12 From bb5b2d66a7a1851f35c1fd18de186ebeafd18738 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Mar 2023 20:15:42 +0000 Subject: arm64e -> arm64. Sync with Tcl --- unix/configure | 24 ++++++++++++------------ unix/tcl.m4 | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/unix/configure b/unix/configure index 4a18d1f..c41864a 100755 --- a/unix/configure +++ b/unix/configure @@ -5565,15 +5565,15 @@ echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 fi ;; - arm64|arm64e) - echo "$as_me:$LINENO: checking if compiler accepts -arch arm64e flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch arm64e flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_arm64e+set}" = set; then + arm64) + echo "$as_me:$LINENO: checking if compiler accepts -arch arm64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch arm64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_arm64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch arm64e" + CFLAGS="$CFLAGS -arch arm64" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5611,22 +5611,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_cv_cc_arch_arm64e=yes + tcl_cv_cc_arch_arm64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -tcl_cv_cc_arch_arm64e=no +tcl_cv_cc_arch_arm64=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_arm64e" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_arm64e" >&6 - if test $tcl_cv_cc_arch_arm64e = yes; then +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_arm64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_arm64" >&6 + if test $tcl_cv_cc_arch_arm64 = yes; then - CFLAGS="$CFLAGS -arch arm64e" + CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes fi @@ -5639,7 +5639,7 @@ echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >& else # Check for combined 32-bit and 64-bit fat build - if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64e) ' \ + if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then fat_32_64=yes diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 6d80d8b..885732d 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1541,16 +1541,16 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes ]);; - arm64|arm64e) - AC_CACHE_CHECK([if compiler accepts -arch arm64e flag], - tcl_cv_cc_arch_arm64e, [ + arm64) + AC_CACHE_CHECK([if compiler accepts -arch arm64 flag], + tcl_cv_cc_arch_arm64, [ hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch arm64e" + CFLAGS="$CFLAGS -arch arm64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [tcl_cv_cc_arch_arm64e=yes],[tcl_cv_cc_arch_arm64e=no]) + [tcl_cv_cc_arch_arm64=yes],[tcl_cv_cc_arch_arm64=no]) CFLAGS=$hold_cflags]) - AS_IF([test $tcl_cv_cc_arch_arm64e = yes], [ - CFLAGS="$CFLAGS -arch arm64e" + AS_IF([test $tcl_cv_cc_arch_arm64 = yes], [ + CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes ]);; *) @@ -1558,7 +1558,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ esac ], [ # Check for combined 32-bit and 64-bit fat build - AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64e) ' \ + AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ fat_32_64=yes]) ]) -- cgit v0.12 From 652d55eb0e1033dee1c9e6ed6807ed447ea749ac Mon Sep 17 00:00:00 2001 From: csaba Date: Mon, 20 Mar 2023 16:49:46 +0000 Subject: Optimized a few SVG gradients. --- generic/ttk/ttkClamTheme.c | 4 ++-- generic/ttk/ttkDefaultTheme.c | 8 ++++---- win/tkWinButton.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 0f5e3bc..fd6c37c 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -317,7 +317,7 @@ static const IndicatorSpec checkbutton_spec = { static const char radiobtnOffData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -329,7 +329,7 @@ static const char radiobtnOffData[] = "\ static const char radiobtnOnData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 0a1afa5..ea5d472 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -414,11 +414,11 @@ static const IndicatorSpec checkbutton_spec = { static const char radiobtnOffData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -431,11 +431,11 @@ static const char radiobtnOffData[] = "\ static const char radiobtnOnData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ diff --git a/win/tkWinButton.c b/win/tkWinButton.c index f75e31e..cc0b589 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -71,11 +71,11 @@ static const char checkbtnOnData[] = "\ static const char radiobtnOffData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ @@ -88,11 +88,11 @@ static const char radiobtnOffData[] = "\ static const char radiobtnOnData[] = "\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ - \n\ + \n\ \n\ \n\ \n\ -- cgit v0.12 From 9bce396b7fb6cd43d16c8b54aa136515dab922c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 22 Mar 2023 20:23:03 +0000 Subject: Documentation for TK_OPTION_INDEX --- doc/SetOptions.3 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 3967b36..2e877af 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -419,6 +419,15 @@ specify octal or hexadecimal numbers, respectively). The internal form is a C \fBint\fR value. This option type supports the \fBTK_OPTION_NULL_OK\fR flag; if a NULL value is set, the internal representation is set to INT_MIN. .TP +\fBTK_OPTION_INDEX\fR +The string value must be an index in the format accepted by \fBTcl_GetIntForIndex()\fR +or the empty string. The internal form is a C \fBint\fR value. If the string +starts with \fB-\fR, the internal representation will be set to INT_MIN. If the +string has the form \fBend-???\fR, then the result will be a negative number: +\fB-1\fR stands for \fBend\fR, \fB-2\fR stands for \fBend-1\fR and so on. +This option type supports the \fBTK_OPTION_NULL_OK\fR flag; +if a NULL value is set, the internal representation is set to INT_MIN. +.TP \fBTK_OPTION_JUSTIFY\fR The value must be a standard justification value such as \fBleft\fR. The internal form is a Tk_Justify like the values returned by -- cgit v0.12 From eccded5b0d102dbfa69e6312c207547d6764e6ec Mon Sep 17 00:00:00 2001 From: sbron Date: Thu, 23 Mar 2023 16:31:54 +0000 Subject: Add tests to check for the issues mentioned in bug [15c685a976]. --- tests/menu.test | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/menu.test b/tests/menu.test index a4522ee..901c253 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3341,6 +3341,46 @@ test menu-20.11 {CloneMenu} -setup { menu .m2 .m1 clone .m2 } -returnCodes error -result {window name "m2" already exists in parent} +test menu-20.12 {CloneMenu - copied bindings on empty menu} -setup { + deleteWindows + set x {} +} -body { + menu .m1 -tearoff 0 + bind .m1 <> {append x <>} + .m1 clone .m2 + event generate .m2 <> + return $x +} -result {<>} +test menu-20.13 {CloneMenu - copied bindings on non-empty menu} -setup { + deleteWindows + set x {} +} -body { + menu .m1 -tearoff 1 + bind .m1 <> {append x <>} + .m1 clone .m2 + event generate .m2 <> + return $x +} -result {<>} +test menu-20.14 {CloneMenu - new binding on empty menu} -setup { + deleteWindows + set x {} +} -body { + menu .m1 -tearoff 0 + .m1 clone .m2 + bind .m1 <> {append x <>} + event generate .m2 <> + return $x +} -result {<>} +test menu-20.15 {CloneMenu - new binding on non-empty menu} -setup { + deleteWindows + set x {} +} -body { + menu .m1 -tearoff 1 + .m1 clone .m2 + bind .m1 <> {append x <>} + event generate .m2 <> + return $x +} -result {<>} test menu-21.1 {MenuDoYPosition} -setup { deleteWindows -- cgit v0.12 From 5cce831f67705a4be1cb95748567d83f473f6e99 Mon Sep 17 00:00:00 2001 From: sbron Date: Thu, 23 Mar 2023 16:34:38 +0000 Subject: Proposed fix for bug [15c685a976]. --- library/tearoff.tcl | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 244b2a5..d11b2b0 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -145,35 +145,4 @@ proc ::tk::MenuDup {src dst type} { } eval $cmd } - - # Duplicate the binding tags and bindings from the source menu. - - set tags [bindtags $src] - set srcLen [string length $src] - - # Copy tags to x, replacing each substring of src with dst. - - while {[set index [string first $src $tags]] >= 0} { - append x [string range $tags 0 $index-1]$dst - set tags [string range $tags $index+$srcLen end] - } - append x $tags - - bindtags $dst $x - - foreach event [bind $src] { - unset x - set script [bind $src $event] - set eventLen [string length $event] - - # Copy script to x, replacing each substring of event with dst. - - while {[set index [string first $event $script]] >= 0} { - append x [string range $script 0 $index-1]$dst - set script [string range $script $index+$eventLen end] - } - append x $script - - bind $dst $event $x - } } -- cgit v0.12 From 3d9151ca96ec14b843fd413ca71c4920c9b5ef59 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 24 Mar 2023 21:14:35 +0000 Subject: Fix [https://core.tcl-lang.org/tcl/tktview/68417a8bb3|68417a8bb3]: No result/LF printed for 64-bit integer type check --- unix/configure | 6 ++++-- unix/tcl.m4 | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/unix/configure b/unix/configure index 3ebf70c..79659ce 100755 --- a/unix/configure +++ b/unix/configure @@ -6466,8 +6466,8 @@ printf "%s\n" "${tcl_flags}" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 -printf %s "checking for 64-bit integer type... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if 'long' and 'long long' have the same size (64-bit)?" >&5 +printf %s "checking if 'long' and 'long long' have the same size (64-bit)?... " >&6; } if test ${tcl_cv_type_64bit+y} then : printf %s "(cached) " >&6 @@ -6504,6 +6504,8 @@ printf "%s\n" "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } # Now check for auxiliary declarations { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 printf %s "checking for struct dirent64... " >&6; } diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 4e205fd..3717893 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2378,7 +2378,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[ #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_64BIT_FLAGS], [ - AC_MSG_CHECKING([for 64-bit integer type]) + AC_MSG_CHECKING([if 'long' and 'long long' have the same size (64-bit)?]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if we could use long anyway Note that we substitute in the @@ -2388,9 +2388,10 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [ case 1: case (sizeof(long long)==sizeof(long)): ; }]])],[tcl_cv_type_64bit="long long"],[])]) if test "${tcl_cv_type_64bit}" = none ; then - AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) + AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, ['long' and 'long long' have the same size]) AC_MSG_RESULT([yes]) else + AC_MSG_RESULT([no]) # Now check for auxiliary declarations AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -- cgit v0.12 From 78d9a8d03c9e9e435ad5a38a379addef0b65d636 Mon Sep 17 00:00:00 2001 From: sbron Date: Sun, 26 Mar 2023 10:51:41 +0000 Subject: Make the clone inherit the bindtags from the original menu. --- library/tearoff.tcl | 25 +++++++++++++++++-------- tests/menu.test | 8 ++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/library/tearoff.tcl b/library/tearoff.tcl index d11b2b0..1dbe858 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -134,15 +134,24 @@ proc ::tk::MenuDup {src dst type} { lappend cmd [lindex $option 0] [lindex $option 4] } eval $cmd + + # Copy the meny entries, if any + set last [$src index last] - if {$last eq "none" || $last < 0} { - return - } - for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { - set cmd [list $dst add [$src type $i]] - foreach option [$src entryconfigure $i] { - lappend cmd [lindex $option 0] [lindex $option 4] + if {$last ne "none" && $last >= 0} { + for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { + set cmd [list $dst add [$src type $i]] + foreach option [$src entryconfigure $i] { + lappend cmd [lindex $option 0] [lindex $option 4] + } + eval $cmd } - eval $cmd } + + # Duplicate the binding tags from the source menu, replacing src with dst + + set tags [bindtags $src] + set x [lsearch -exact $tags $src] + if {$x >= 0} {lset tags $x $dst} + bindtags $dst $tags } diff --git a/tests/menu.test b/tests/menu.test index 901c253..a27e158 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3381,6 +3381,14 @@ test menu-20.15 {CloneMenu - new binding on non-empty menu} -setup { event generate .m2 <> return $x } -result {<>} +test menu-20.16 {CloneMenu - bindtags} -setup { + deleteWindows +} -body { + menu .m1 + bindtags .m1 [linsert [bindtags .m1] 1 .m1.sub1] + .m1 clone .m2 + bindtags .m2 +} -result {.m2 .m1 .m1.sub1 Menu all} test menu-21.1 {MenuDoYPosition} -setup { deleteWindows -- cgit v0.12 From c3a7ccd432c25fc391105311d13c93423ca5771a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 Mar 2023 16:35:40 +0000 Subject: Make tests 20.12 to -15 pass on Windows. In details: on this platform the cloned menu window does not exist at the time [event generate] is called, which prevents the event from being actually generated. The cloned menu needs to be posted for its window to exist. Then, on Windows, a 'normal' clone posted menu blocks the event loop --> remedy: make the clone of 'tearoff' type when cloning, therefore posting it makes its window exist and does not block the event loop, which in turn allows the event to be generated and serviced. --- tests/menu.test | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/menu.test b/tests/menu.test index a27e158..152d2f4 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -3347,7 +3347,8 @@ test menu-20.12 {CloneMenu - copied bindings on empty menu} -setup { } -body { menu .m1 -tearoff 0 bind .m1 <> {append x <>} - .m1 clone .m2 + .m1 clone .m2 tearoff + .m2 post 100 100 event generate .m2 <> return $x } -result {<>} @@ -3357,7 +3358,8 @@ test menu-20.13 {CloneMenu - copied bindings on non-empty menu} -setup { } -body { menu .m1 -tearoff 1 bind .m1 <> {append x <>} - .m1 clone .m2 + .m1 clone .m2 tearoff + .m2 post 100 100 event generate .m2 <> return $x } -result {<>} @@ -3366,7 +3368,8 @@ test menu-20.14 {CloneMenu - new binding on empty menu} -setup { set x {} } -body { menu .m1 -tearoff 0 - .m1 clone .m2 + .m1 clone .m2 tearoff + .m2 post 100 100 bind .m1 <> {append x <>} event generate .m2 <> return $x @@ -3376,7 +3379,8 @@ test menu-20.15 {CloneMenu - new binding on non-empty menu} -setup { set x {} } -body { menu .m1 -tearoff 1 - .m1 clone .m2 + .m1 clone .m2 tearoff + .m2 post 100 100 bind .m1 <> {append x <>} event generate .m2 <> return $x -- cgit v0.12 From ea371117d2abdc1fec0daf49dd2f8709c0fd857a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 26 Mar 2023 21:22:11 +0000 Subject: Make test-case option-15.1 independant on test-case casing (as everywhere else) --- tests/option.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/option.test b/tests/option.test index 2292996..8bc7f21 100644 --- a/tests/option.test +++ b/tests/option.test @@ -361,8 +361,8 @@ test option-14.12 {error conditions} -body { set option1 [file join [testsDirectory] option.file1] test option-15.1 {database files} -body { - option read non-existent -} -returnCodes error -result {couldn't open "non-existent": no such file or directory} + list [catch {option read non-existent} msg] [string tolower $msg] +} -result {1 {couldn't open "non-existent": no such file or directory}} test option-15.2 {database files} -body { option read $option1 option get . x1 color -- cgit v0.12 From bcd20424a5cf76ad6d464be73fe07aa2adc70e4e Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Mar 2023 20:14:56 +0000 Subject: Fix [ee0847f633]: Aqua: compiler warning in debug builds. --- macosx/tkMacOSXDialog.c | 2 +- macosx/tkMacOSXEvent.c | 2 +- macosx/tkMacOSXInit.c | 2 +- macosx/tkMacOSXKeyEvent.c | 4 ++-- macosx/tkMacOSXKeyboard.c | 2 +- macosx/tkMacOSXMenu.c | 4 ++-- macosx/tkMacOSXMouseEvent.c | 2 +- macosx/tkMacOSXWindowEvent.c | 30 +++++++++++++++--------------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 5170545..2e38866 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1657,7 +1657,7 @@ enum FontchooserOption { - (void) windowDidOrderOffScreen: (NSNotification *)notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if ([[notification object] isEqual:[[NSFontManager sharedFontManager] fontPanel:NO]]) { diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 31a7663..6afaca4 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -27,7 +27,7 @@ enum { - (NSEvent *) tkProcessEvent: (NSEvent *) theEvent { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif NSEvent *processedEvent = theEvent; NSEventType type = [theEvent type]; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index a9b459a..0ddf627 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -112,7 +112,7 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #ifdef TK_MAC_DEBUG_NOTIFICATIONS - (void) _postedNotification: (NSNotification *) notification { - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); } #endif diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 961072f..a6ab89b 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -47,7 +47,7 @@ static NSUInteger textInputModifiers; - (NSEvent *) tkProcessKeyEvent: (NSEvent *) theEvent { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif NSWindow *w = [theEvent window]; TkWindow *winPtr = TkMacOSXGetTkWindow(w), *grabWinPtr, *focusWinPtr; @@ -146,7 +146,7 @@ static NSUInteger textInputModifiers; #if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1 TKLog(@"-[%@(%p) %s] repeat=%d mods=%x char=%x code=%lu c=%d type=%d", - [self class], self, _cmd, + [self class], self, sel_getName(_cmd), (type == NSKeyDown) && [theEvent isARepeat], modifiers, keychar, virt, w, type); #endif diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index fe2991e..2e43258 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -153,7 +153,7 @@ static int KeyDataToUnicode(UniChar *uniChars, int maxChars, { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #else (void)notification; #endif diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index c10944a..f853abe 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -501,7 +501,7 @@ static Bool runMenuCommand = true; { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (backgroundLoop) { [backgroundLoop cancel]; @@ -522,7 +522,7 @@ static Bool runMenuCommand = true; { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (backgroundLoop) { [backgroundLoop cancel]; diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index e33f787..0286343 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -98,7 +98,7 @@ enum { static NSTimeInterval timestamp = 0; #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif /* diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index ef8e958..ab776c0 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -50,7 +50,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowActivation: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif NSWindow *w = [notification object]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -85,7 +85,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowBoundsChanged: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif BOOL movedOnly = [[notification name] isEqualToString:NSWindowDidMoveNotification]; @@ -123,7 +123,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowExpanded: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif NSWindow *w = [notification object]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -180,7 +180,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowEnteredFullScreen: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (![[notification object] respondsToSelector: @selector (tkLayoutChanged)]) { return; @@ -191,7 +191,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowExitedFullScreen: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (![[notification object] respondsToSelector: @selector (tkLayoutChanged)]) { return; @@ -202,7 +202,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowCollapsed: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif NSWindow *w = [notification object]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -216,7 +216,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (BOOL) windowShouldClose: (NSWindow *) w { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, w); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), w); #endif TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -275,12 +275,12 @@ extern NSString *NSWindowDidOrderOffScreenNotification; - (void) windowDragStart: (NSNotification *) notification { - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); } - (void) windowUnmapped: (NSNotification *) notification { - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); NSWindow *w = [notification object]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); @@ -342,7 +342,7 @@ static void RefocusGrabWindow(void *data) { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif [NSApp tkCheckPasteboard]; @@ -377,7 +377,7 @@ static void RefocusGrabWindow(void *data) { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif /* @@ -415,7 +415,7 @@ static void RefocusGrabWindow(void *data) { - (void) applicationShowHide: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif const char *cmd = ([[notification name] isEqualToString: NSApplicationDidUnhideNotification] ? @@ -436,7 +436,7 @@ static void RefocusGrabWindow(void *data) { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif TkDisplay *dispPtr = TkGetDisplayList(); @@ -1299,7 +1299,7 @@ static const char *const accentNames[] = { - (void) tkToolbarButton: (id) sender { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd)); #endif union {XEvent general; XVirtualEvent virt;} event; int x, y; @@ -1352,7 +1352,7 @@ static const char *const accentNames[] = { (void)theEvent; #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif } -- cgit v0.12 From 54c59c88d1eae7793b9be25da00eef4905e8c2e5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Mar 2023 20:20:21 +0000 Subject: Fix [2ed289cae0]: Aqua: more format specifiers than arguments in tkToolbarButton --- macosx/tkMacOSXWindowEvent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index ab776c0..e520bb0 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -1299,7 +1299,7 @@ static const char *const accentNames[] = { - (void) tkToolbarButton: (id) sender { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd)); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), sender); #endif union {XEvent general; XVirtualEvent virt;} event; int x, y; -- cgit v0.12