Hello ltk-users<br><br>After looking at gtk, qt, and other widget tool kits, from my noob perspective, ltk-tile looked the most promising (even I might be able to do it!) for creating guis with native look and feel. Hats off to Mr. Herth in extreme thanks for his work.<br>
<br>However, I am finding scanty documentation on ltk-tile, and have been mostly relying on the ltk-tile.lisp file to try and figure out it's syntax. , In the example function (tile-test), though creating a window with a label, an entry, and a button, the button doesn't do anything.<br>
<br>I am hereby pasting in the code of two separate files. The first one successfully uses ltk to create a frame with a button in it that outputs "Hello!" to the console when the button is clicked. <br><br>The second file tries to do the same thing, only using ltk-tile instead, but it is unsuccessful at outputing anything to the console. Because I am new to lisp, I still sometimes separate and indent the parentheses to help me visually comprehend what is inside of what. <br>
<br>Here is code of first file:<br><br><div style="margin-left: 40px;"><i>;; making a button in ltk that outputs "Hello" to the console when clicked<br><br>; load dependent systems<br>(load "/usr/local/lisp/systems/ltk/ltk")<br>
(in-package :ltk)<br><br>; define function<br>(defun hellobutton ()<br> (with-ltk ()<br> (let* (<br> (f (make-instance 'frame))<br> (b (make-instance 'button<br> :master f<br> :text "hellobutton"<br>
:command (lambda ()<br> (format t "~%~THello!~%"))))<br> )<br> (pack f)<br> (pack b)<br> (mainloop)<br> )))<br><br>; use function<br>(hellobutton)<br>
</i></div><br><br>The above worked!!! But when I try it with ltk-tile it doesn't work. Here is the ltk-tile code that is trying to do same thing:<br><br><div style="margin-left: 40px;"><i>;; trying to make a button with ltk-tile that outputs "Hello" to the console when clicked<br>
<br>; load dependent systems<br>(load "/usr/local/lisp/systems/ltk/ltk")<br>(load "/usr/local/lisp/systems/ltk/ltk-tile")<br>(in-package :ltk-tile)<br><br>; define function<br>(defun hellobutton ()<br>
(activate-tile)<br> (with-ltk ()<br> (let* (<br> (f (make-instance 'frame))<br> (b (make-instance 'button<br> :master f<br> :text "hellobutton"<br> :command (lambda ()<br>
(format t "~%~THello!~%"))))<br> )<br> (pack f)<br> (pack b)<br> (dolist (theme (theme-names))<br> (make-menubutton mtheme theme (lambda()<br> (use-theme theme))))<br>
(mainloop)<br> )))<br><br>; use function<br>(hellobutton)<br></i></div><br><br>Unfortunately I am new to lisp, tcl, tk, and gui programming in general. Any links to additional examples or tutorials on ltk-tile would be appreciated. I am happy to buy books too, so long as they cover ltk-tile.<br>
<br>Thanks in advance,<br><br>--Slac-in-the-box<br><br>(p.s. I've started my 12-year-old on lisp, and he has already made a text game in the fashioned after bsd-games "adventure" and he squeals with excitement (same joyous sounds he makes on the way to visit other kids) whenever he gets something to work! He is only a day or two behind on learning ltk and is asking questions for which I haven't any answers. Thus, the pressure is on for me to find answers!)<br>
<br>