newLISP-TK with DLL possible?
Posted: Mon Oct 18, 2004 6:09 pm
I run some test to use newLISP.DLL direct from TclTk
I use Ffidl Version 0.5 from:
http://elf.org/ffidl/
Here a test code for calling the DLL:
There is now the question, if a alternativ newLISP-TK can be build which use the DLL instead of the EXE. Calling LISP is not the problem, but the EXE version use a callback technik via TCP, where I am not sure if it can be done with the DLL.
For what it can be usable:
For systems without installed TCP-IP stack.
For systems with have security concerns with personal firewalls.
One process solution
I use Ffidl Version 0.5 from:
http://elf.org/ffidl/
Here a test code for calling the DLL:
Code: Select all
package require Ffidl 0.5
ffidl::callout dll_EvalStr {pointer-utf8} pointer-utf8 [ffidl::symbol newlisp.dll newlispEvalStr]
proc EvalStr { lispstring } {
dll_EvalStr $lispstring
}
proc exit? {} {
set answer [tk_messageBox -message "Really quit?" -type yesno -icon question]
switch -- $answer {
yes {
exit
}
no {}
}
}
proc LispTest {win} {
set size(X) 200
set size(Y) 200
toplevel $win
wm title $win "Tcl-Lisp" ;
wm overrideredirect $win true
update idletasks ;
set lispreturn0 [EvalStr "(setq a (+ 5 6))"]
set lispreturn1 [EvalStr "(+ a 7)"]
canvas $win.c -background yellow -width $size(X) -height $size(Y) -relief flat -bd 0
$win.c create text 100 100 -fill navy -font {Times 12} -text $lispreturn0
$win.c create text 100 130 -fill navy -font {Times 12} -text $lispreturn1
pack $win.c -expand yes -fill both
focus -force $win
bind $win <Key> exit?
bind $win <Motion> {}
}
wm withdraw .
LispTest .scr
For what it can be usable:
For systems without installed TCP-IP stack.
For systems with have security concerns with personal firewalls.
One process solution