Greetings all,
I've been very interested in locating an easy to distribute, cross platform gui library that will allow for gui development in common lisp. After finding out about tclkits and seeing how small they are, I get the impression that this goal is reachable via distribution of the platform specific tclkit along with a common lisp image (with ltk configured to locate the supplied tclkit). I didn't find an archive of this list, and from what I've read in ltk docs, it seems like this concept is easily supported, but I am rather new to common lisp and tcl/tk. Given that I am new to common lisp, I don't necessarily know what part of the ltk code I need to read in order to figure out how to invoke a local instance of tcl/tk (let alone make a connection to a remote-tcl).
I am open to anything, if someone has walked this path before and knows of some documentation that might be illuminating, I'm all ears. In addition, if anyone has any suggestions about how I might go about this whole cross platform gui common lisp development effort more easily, I'm also all ears.
My short term goal is to produce enough material to run the ltkdemo (or at least, my own hello world code) from a lisp image that references a supplied tclkit on at least osx and windows.
Cheers!
Running a local version of wish is easy enough: just bind the LTK:*WISH-PATHNAME* variable to the pathname of your binary before using LTK:START-WISH or LTK:WITH-LTK. Using a different binary for different platforms is just a matter of using the #+ and #- reader macros to get the right pathname.
Using starkits for extensions is also quite simple, but you'll need to implement a few things yourself: you'll have write some code to load the startkit package in tcl (see LTK:*INIT-WISH-HOOK*), create a binding in ltk for loading the kits themselves (and any code in them), and you'll probably want one for loading dll-based libs (some extensions like TWAPI don't have starkits readily available).
I've got code for most of this around, which I'll try to post tonight after work.
-Matt Stickney
On Mon, Dec 16, 2013 at 2:16 PM, Joshua Kordani jkordani@lsa2.com wrote:
Greetings all,
I've been very interested in locating an easy to distribute, cross platform gui library that will allow for gui development in common lisp. After finding out about tclkits and seeing how small they are, I get the impression that this goal is reachable via distribution of the platform specific tclkit along with a common lisp image (with ltk configured to locate the supplied tclkit). I didn't find an archive of this list, and from what I've read in ltk docs, it seems like this concept is easily supported, but I am rather new to common lisp and tcl/tk. Given that I am new to common lisp, I don't necessarily know what part of the ltk code I need to read in order to figure out how to invoke a local instance of tcl/tk (let alone make a connection to a remote-tcl).
I am open to anything, if someone has walked this path before and knows of some documentation that might be illuminating, I'm all ears. In addition, if anyone has any suggestions about how I might go about this whole cross platform gui common lisp development effort more easily, I'm also all ears.
My short term goal is to produce enough material to run the ltkdemo (or at least, my own hello world code) from a lisp image that references a supplied tclkit on at least osx and windows.
Cheers!
-- Joshua Kordani LSA Autonomy
On 12/16/13 2:41 PM, Matthew Stickney wrote:
Using starkits for extensions is also quite simple, but you'll need to implement a few things yourself: you'll have write some code to load the startkit package in tcl (see LTK:*INIT-WISH-HOOK*), create a binding in ltk for loading the kits themselves (and any code in them), and you'll probably want one for loading dll-based libs (some extensions like TWAPI don't have starkits readily available).
Thanks Matt I appreciate the tip. Do you find that you make use of extensions related to Tk, or related to Tcl instead?
I've attached the little bit of code I use for working with starkits and so forth in ltk (it uses cl-fad for pathname munging, but you might be able to do without). My main entry point function then looks something like the following (making sure ltk-libs.lisp gets loaded first, of course):
(defun main () (let ((ltk:*wish-pathname* (namestring (merge-pathnames #-(or :win32 :mswindows) "tclkit-linux-x86" #+(or :win32 :mswindows)
"tclkit-win32.upx.exe")))) (ltk:with-ltk () ;; Load the necessary starkits (ensure-kits '("tkvideo.kit" "tkvideo") '("img.kit" "Img") '("winico06.kit" "Winico")) (load-lib "twapi-x86-3.1.17.dll" "twapi")
<main application body here>)))
On Mon, Dec 16, 2013 at 4:54 PM, Joshua Kordani jkordani@lsa2.com wrote:
Thanks Matt I appreciate the tip. Do you find that you make use of extensions related to Tk, or related to Tcl instead?
Unfortunately I only get to use Lisp at work when I can sneak it in under the radar, so I haven't done a great deal with ltk (and not much cross-platform stuff at that). So far all the starkits I've used have been Tk related: the kits above are from a recent utility I wrote, and are for webcam video display/capture, image formats (jpeg, png and so forth), system tray icons, and some windows API bindings, respectively. I had to write some bindings in ltk for some widgets that weren't completely covered (I'll post them here as patches one of these days), but that's about all. Again, I'm not exactly pushing the envelope here, but I think ltk will get the job done quite well unless you're trying to do something especially fancy.
-Matt Stickney
Thanks for the code example. My concept application that I have in mind is like a mini google earth (no 3d), allowing the user to display a map of an area and view and place objects on the map given real world coordinates. Given the existence of AndroWish (a port of tcl/tk for android), I'd also start exploring using lisp and that for android gui development.
On 12/16/13 10:01 PM, Matthew Stickney wrote:
I've attached the little bit of code I use for working with starkits and so forth in ltk (it uses cl-fad for pathname munging, but you might be able to do without). My main entry point function then looks something like the following (making sure ltk-libs.lisp gets loaded first, of course):
(defun main () (let ((ltk:*wish-pathname* (namestring (merge-pathnames #-(or :win32 :mswindows) "tclkit-linux-x86" #+(or :win32 :mswindows)
"tclkit-win32.upx.exe")))) (ltk:with-ltk () ;; Load the necessary starkits (ensure-kits '("tkvideo.kit" "tkvideo") '("img.kit" "Img") '("winico06.kit" "Winico")) (load-lib "twapi-x86-3.1.17.dll" "twapi")
<main application body here>)))
On Mon, Dec 16, 2013 at 4:54 PM, Joshua Kordani jkordani@lsa2.com wrote:
Thanks Matt I appreciate the tip. Do you find that you make use of extensions related to Tk, or related to Tcl instead?
Unfortunately I only get to use Lisp at work when I can sneak it in under the radar, so I haven't done a great deal with ltk (and not much cross-platform stuff at that). So far all the starkits I've used have been Tk related: the kits above are from a recent utility I wrote, and are for webcam video display/capture, image formats (jpeg, png and so forth), system tray icons, and some windows API bindings, respectively. I had to write some bindings in ltk for some widgets that weren't completely covered (I'll post them here as patches one of these days), but that's about all. Again, I'm not exactly pushing the envelope here, but I think ltk will get the job done quite well unless you're trying to do something especially fancy.
-Matt Stickney
Hi Joshua,
I have done this before.
For a double-clickable windows executable, it is trivial. Download the tclkit executable, and install it into the same path as your executable. Windows defaults to the CWD being the directory the executable is in, so you are done.
OS-X Is a bit harder, as a bundle is lanched with the unix CWD equal to /. ClozureCL makes it relatively easy to call into objective C though, so if you want to depend on that, you can call into the framework that lets you get the bundle path. Then you can put the lisp executable and the tclkit in the bundle and again it all works.
I'm looking for a way to do OS X from sbcl, and I know it's possible, but I haven't had the spare cycles to figure it out at the moment.
FYI for linux I just require that they have tcl >= 8.5 installed and in $PATH. It's usually not a problem.
-Jason
On 14:16 Mon 16 Dec , Joshua Kordani wrote:
Greetings all, I've been very interested in locating an easy to distribute, cross platform gui library that will allow for gui development in common lisp. After finding out about tclkits and seeing how small they are, I get the impression that this goal is reachable via distribution of the platform specific tclkit along with a common lisp image (with ltk configured to locate the supplied tclkit). I didn't find an archive of this list, and from what I've read in ltk docs, it seems like this concept is easily supported, but I am rather new to common lisp and tcl/tk. Given that I am new to common lisp, I don't necessarily know what part of the ltk code I need to read in order to figure out how to invoke a local instance of tcl/tk (let alone make a connection to a remote-tcl). I am open to anything, if someone has walked this path before and knows of some documentation that might be illuminating, I'm all ears. In addition, if anyone has any suggestions about how I might go about this whole cross platform gui common lisp development effort more easily, I'm also all ears. My short term goal is to produce enough material to run the ltkdemo (or at least, my own hello world code) from a lisp image that references a supplied tclkit on at least osx and windows. Cheers! -- Joshua Kordani LSA Autonomy
Jason,
Thanks for your reply. I appreciate your feedback.
On 12/16/13 4:36 PM, Jason Miller wrote:
OS-X Is a bit harder, as a bundle is lanched with the unix CWD equal to /. ClozureCL makes it relatively easy to call into objective C though, so if you want to depend on that, you can call into the framework that lets you get the bundle path. Then you can put the lisp executable and the tclkit in the bundle and again it all works.
I did plan on using ccl, and I think it includes a relatively easy to use bundle maker, but I think that running my program from the command line will suit for the time being, the assumption being that its easier to get to that point than to stand up a bundle. I might be wrong but we'll see.
FYI for linux I just require that they have tcl >= 8.5 installed and in $PATH. It's usually not a problem.
Have you felt and pressure to build your own tclkits in order to track the latest versions of Tcl/Tk?