#7 Error when clicking button

Closed
opened 2 months ago by barthes · 8 comments
barthes commented 2 months ago

Hi

I am trying to run NODGUI with CCL 1.11.6 on MacOS Sierra (10.12.6) and all test examples do post a window, but clicking on any button yields the same error, e.g. with the hello-1 example (details):

unknown or ambiguous subcommand "cat": must be bytelength, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart unknown or ambiguous subcommand "cat": must be bytelength, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart

while executing

"string cat $res $i "

(procedure "strcat" line 3)
invoked from within

"strcat "(" ":callback" \"$s\" ")""

(procedure "callback" line 3)
invoked from within

"callback nc"

invoked from within

".nc invoke "

invoked from within

".nc instate {pressed !disabled} { .nc state !pressed; .nc invoke } "

(command bound to event)

It was not the case with ltk. Is there a simple way to fix this problem? Thank you Jean-Paul

Hi I am trying to run NODGUI with CCL 1.11.6 on MacOS Sierra (10.12.6) and all test examples do post a window, but clicking on any button yields the same error, e.g. with the hello-1 example (details): unknown or ambiguous subcommand "cat": must be bytelength, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart unknown or ambiguous subcommand "cat": must be bytelength, compare, equal, first, index, is, last, length, map, match, range, repeat, replace, reverse, tolower, totitle, toupper, trim, trimleft, trimright, wordend, or wordstart while executing "string cat $res $i " (procedure "strcat" line 3) invoked from within "strcat "(" ":callback" \"$s\" ")"" (procedure "callback" line 3) invoked from within "callback nc" invoked from within ".nc invoke " invoked from within ".nc instate {pressed !disabled} { .nc state !pressed; .nc invoke } " (command bound to event) It was not the case with ltk. Is there a simple way to fix this problem? Thank you Jean-Paul
cage commented 2 months ago
Owner

Hi!

thank you for reporting this issue! :) Unfortunately i have not a chance to access on a apple system. I can confirm that nodgui works with CCL (on ARM, even if i needed to upgrade asdf for it to run). Seems to me that you are getting error from the TCL interpreter. My best guess here is that the TCL interpreter is not able to understand the subcommand 'cat' of command 'string', as described here:

http://www.tcl-lang.org/man/tcl8.6/TclCmd/string.htm

apparently this subcommand was added in version 8.6 as i am not able to find in documentation for version 8.5

http://www.tcl-lang.org/man/tcl8.5/TclCmd/string.htm

Is there any chance that the version of TCL you are using is older than 8.6 version? Is this the TCL interpreter that is shipped with your OS?

If both are true may i ask you to upgrade your interpreter and retry?

Please note that if you have installed two different TCLs on your system probably (if the default point to the older one) you supposed to set the variable:

https://notabug.org/cage/nodgui/src/master/src/wish-communication.lisp#L94

with the path of the newer TCL

Otherwise many horrible errors is going to arise! :)

If this solve this issue can you please report this so i can update the documentation.

Sorry but turned out that i have added more questions and no answers here! ;-D

Thank you very much! C.

Hi! thank you for reporting this issue! :) Unfortunately i have not a chance to access on a apple system. I can confirm that nodgui works with CCL (on ARM, even if i needed to upgrade asdf for it to run). Seems to me that you are getting error from the TCL interpreter. My best guess here is that the TCL interpreter is not able to understand the subcommand 'cat' of command 'string', as described here: http://www.tcl-lang.org/man/tcl8.6/TclCmd/string.htm apparently this subcommand was added in version 8.6 as i am not able to find in documentation for version 8.5 http://www.tcl-lang.org/man/tcl8.5/TclCmd/string.htm Is there any chance that the version of TCL you are using is older than 8.6 version? Is this the TCL interpreter that is shipped with your OS? If both are true may i ask you to upgrade your interpreter and retry? Please note that if you have installed two different TCLs on your system probably (if the default point to the older one) you supposed to set the variable: https://notabug.org/cage/nodgui/src/master/src/wish-communication.lisp#L94 with the path of the newer TCL Otherwise many horrible errors is going to arise! :) If this solve this issue can you please report this so i can update the documentation. Sorry but turned out that i have added more questions and no answers here! ;-D Thank you very much! C.
cage commented 2 months ago
Owner

Hi,

To check your interpreter version in a terminal type:

$ tclsh

and then:

%  info tclversion
8.6
% 

https://www.tcl.tk/man/tcl8.7/TclCmd/info.htm#M40

Bye! C.

Hi, To check your interpreter version in a terminal type: ``` sh $ tclsh ``` and then: ``` tcl % info tclversion 8.6 % ``` https://www.tcl.tk/man/tcl8.7/TclCmd/info.htm#M40 Bye! C.
barthes commented 2 months ago
Poster

tclversion was indeed 8.5. I will upgrade it to 8.6 and run the examples again

tclversion was indeed 8.5. I will upgrade it to 8.6 and run the examples again
cage commented 2 months ago
Owner

Thank you for testing nodgui on this platform!

Bye! C.

Thank you for testing nodgui on this platform! Bye! C.
barthes commented 2 months ago
Poster

Thank you for your kind advice. I found the culprit: the MacOS Tcl interpreter is located in the /System/Library/Frameworks/ folder, which in my case contained Tcl version 4 and version 5. When one installs the latest version using ActiveTcl (ActiveTcl-8.6.9.8609.2-macosx10.9-x86_64-93b04018), it ends up in the /Library/Frameworks/ folder which is another branch that does not seem to have priority. I think I have to reinstall Tcl version 6 into the System branch, which should solve the problem. Thank you again. Jean-Paul

Thank you for your kind advice. I found the culprit: the MacOS Tcl interpreter is located in the /System/Library/Frameworks/ folder, which in my case contained Tcl version 4 and version 5. When one installs the latest version using ActiveTcl (ActiveTcl-8.6.9.8609.2-macosx10.9-x86_64-93b04018), it ends up in the /Library/Frameworks/ folder which is another branch that does not seem to have priority. I think I have to reinstall Tcl version 6 into the System branch, which should solve the problem. Thank you again. Jean-Paul
cage commented 2 months ago
Owner

Hi!

happy to help! :)

I was thinking that maybe you can set the $PATH environment variable to look for binary in /Library/Frameworks/ before /System/Library/Frameworks/ or, alternatively, just bind the special variable nodgui:*wish-pathname*

to the path of the newer wish, something like:

(let ((nodgui:*wish-pathname* "/Library/Frameworks/path/to/wish"))
 (nodgui.demo:demo))

Bye! C.

Hi! happy to help! :) I was thinking that maybe you can set the $PATH environment variable to look for binary in `/Library/Frameworks/` before `/System/Library/Frameworks/` or, alternatively, just bind the special variable `nodgui:*wish-pathname*` to the path of the newer wish, something like: ``` lisp (let ((nodgui:*wish-pathname* "/Library/Frameworks/path/to/wish")) (nodgui.demo:demo)) ``` Bye! C.
barthes commented 2 months ago
Poster

Hi, I bound the wish-pathname to "/Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish" and the examples are now working. Thank you again. Jean-Paul

Hi, I bound the *wish-pathname* to "/Library/Frameworks/Tk.framework/Versions/8.6/Resources/Wish.app/Contents/MacOS/Wish" and the examples are now working. Thank you again. Jean-Paul
cage commented 2 months ago
Owner

Great news! :))

I am going to update the documentation with this useful informations!

Hope you enjoy the library, too! :)

Bye!

C.

Great news! :)) I am going to update the documentation with this useful informations! Hope you enjoy the library, too! :) Bye! C.
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.