optcl for TCL/TK possible in newlisp-tk?

Q&A's, tips, howto's

optcl for TCL/TK possible in newlisp-tk?

Postby HPW » Mon Oct 13, 2003 7:17 am

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

Example on use here:

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
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby HPW » Tue Oct 14, 2003 5:04 am

So the question is: Can we use TCL/TK extensions under newlisp?
Hans-Peter
HPW
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby Lutz » Tue Oct 14, 2003 12:16 pm

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
Last edited by Lutz on Tue Oct 14, 2003 11:31 pm, edited 1 time in total.
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby HPW » Tue Oct 14, 2003 2:08 pm

Lutz,

Thanks for the quick response and description.
Sounds very promising.
Have to check it as soon as possible.
Hans-Peter
HPW
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby HPW » Tue Oct 14, 2003 7:15 pm

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
HPW
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby Lutz » Tue Oct 14, 2003 11:26 pm

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 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
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby HPW » Wed Oct 15, 2003 5:31 am

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
HPW
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby Lutz » Wed Oct 15, 2003 4:19 pm

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
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby HPW » Wed Oct 15, 2003 5:37 pm

Reinstalling the BWidget-dir on my home PC fixes the wrapping.
Could be that I have installed the widgets which comes with TCL.

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.


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
HPW
 
Posts: 1375
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany

Postby Lutz » Wed Oct 15, 2003 10:01 pm

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

Lutz
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron