optcl for TCL/TK possible in newlisp-tk?

Started by HPW, October 13, 2003, 12:17:18 AM

Previous topic - Next topic

HPW

Searching on Tcl/Tk for an embedable browser-object I found optcl for Tcl/Tk from here:



http://www2.cmp.uea.ac.uk/~fuzz/optcl/default.html">http://www2.cmp.uea.ac.uk/~fuzz/optcl/default.html



Example on use here:



http://mini.net/tcl/newzpoint">http://mini.net/tcl/newzpoint



Is this possible or usable in newlisp?



Idea: Offline version of web-app by using a local newlisp-server with a web-front-end embeded in it's own tk-window.
Hans-Peter

HPW

#1
So the question is: Can we use TCL/TK extensions under newlisp?
Hans-Peter

Lutz

#2
Yes, you can, by modifying the wrapping process. All the files necessary are in the distribution. These are the steps:



(1) in newlisp-tk.tcl add your extension package the same way the BWdigget set was added:



lappend auto_path "/myextension"

package require myextension



(2) Then unzip the freewrap package in a directory c:freewrap and put your extension package in a directory c:myextension



(3)  put newlisp-tk.tcl, images.txt, bwidget.txt and the file make-wrapped-exe.bat also in the c:freewrap directory.



(4) put also the directory "images" into the freewrap directory. You find it in newlisp-_xxx/newlisp-tk/images.



(5) unzip the BWidget distribution into c: and rename it to c:bwidget. It has to be the same name as in bwidget.txt.



(6) make a file myextension.txt similar to bwidget.txt and modify make-wrapped-exe.bat adding myextension.txt in to the command line:



freewrap newlisp-tk.tcl -f images.txt -f bwidget.txt -f myextension.txt



Thats it, move the new newlisp-tk.exe into you newlisp directory and give it a try.



Lutz



ps: changes where made after the original post

HPW

#3
Lutz,



Thanks for the quick response and description.

Sounds very promising.

Have to check it as soon as possible.
Hans-Peter

HPW

#4
Your description missed that I must have an istalled TCL 8.4 and a BWidget-Dir in C:.



When I try your advice I get an error that this image is missing:



/freawrap/images/reloadImg.gif



It is a typo in the pathname in images.txt!



But I end with an working newlisp-tk.exe with 1811KB instead of your 7.2.2 with 1999KB. Anything wrong?
Hans-Peter

Lutz

#5
You do not need Tcl/Tk installed. All the Tcl/Tk stuff comes in freewrap55.zip. Most of the Tcl/Tk stuff is contained in 'freewrap.exe'



Make sure the c:bwidget directory has the same name as used in the bwidget.txt file.



You may be using an older freewrap which still does compression. This may be the reason you get a smaller newlisp-tk.exe. The later once abandoned compression (I think after 5.2) because of problems. I am using currently FreeWrap v. 5.5, which you also can find in the http://newlisp.org/download/Tools">http://newlisp.org/download/Tools directory.



Make sure the bwidget directory has the same name as used in the bwidget.txt file.



I forgot to tell that you have to move the "images" directory from the distribution "newlisp_xxx/newlisp-tk/images" into the freewrap directory. I checked the spelling of the gifs, they seem to be fine. the files in images.txt must match the files in the images directory. Same for the bwidget and  your "myextension" stuff.



When you test your resulting newlisp-tk.exe, make sure to rename the c:bwidget directory to "c:bwidgetbackup" or something, to make sure it really takes bwidgets from the wrapped stuff. The best thing to test your newlisp-tk.exe, is on a different computer without any Tcl/Tkl stuff.





Lutz



ps: I updated the original post with the missing stuff

HPW

#6
Lutz,



Thanks for the hints, I tried it on another machine and it works.

Now I get 1.999 KB. Can the fresh installed TCL 8.4.4 on my home mashine

be the reason for the smaller EXE?



But your typo in newlisp_7202.tgz remains in image.txt



/freawrap/images/reloadImg.gif



should be:



/freewrap/images/reloadImg.gif
Hans-Peter

Lutz

#7
finally could recognize the spelling error, thanks!



About the smaller size of your newlisp-tk.exe. Freewrap uses Tcl/Tl 8.3 Are you sure it also wrapped bwidgets too? try the following:



(tk "ComboBox")



If it comes back with "Invalid Command Name, you don't have bwidgets. Instead the error message should complain about missing/wrong parameters in ComboBox.



The wrapping stuff is sometimes a pain, but once you get it right, its quick. Freewrap its it's own flesystem with root 'freewrap/', this means you also could wrap newLISP Lisp source files into it and in this way deliver applications.



As long as you don't wrap the newLISP executable newlisp.exe  into it too, you are fine license wise and can even commercialize your application without open sourcing you own Lisp source.



Lutz

HPW

#8
Reinstalling the BWidget-dir on my home PC fixes the wrapping.

Could be that I have installed the widgets which comes with TCL.


QuoteThe wrapping stuff is sometimes a pain, but once you get it right, its quick. Freewrap its it's own flesystem with root 'freewrap/', this means you also could wrap newLISP Lisp source files into it and in this way deliver applications.


This was my question from the new thread.

How do I access the wrapped lisp source from newlisp?



Do I use "LOAD"? But whats the pathname? Explain please?
Hans-Peter

Lutz

#9
Yes, you can; my answer is on the other thread: "load lisp-files from inside wrapped EXE"



Lutz