From: Martin DeMello
Subject: ltk hanging under lisp-in-a-box+clisp on windows
Date: 
Message-ID: <f93a6bcc.0503201133.5af5c50@posting.google.com>
I finally managed to get ltk installed properly under lisp in a box
(the liab docs should at least have a pointer to the 'getting asdf
working under windows' docs - I had a reasonably hard time with it,
and was cheerfully ignored in #lisp when I asked for help), but now
I'm facing further problems actually getting stuff up and running. I'm
trying out the basic 'hello world' example:

|(asdf:operate 'asdf:load-op :ltk)
|
|(defun hello-1 ()
|  (ltk:with-ltk
|      (let ((b (make-instance 'ltk:button
|                              :master nil
|                              :text "press me"
|                              :command (lambda ()
|                                         (format t "hello world!
~&")))))
|        (ltk:pack b))))

Firstly, this doesn't work when I hit C-C C-K inside emacs - it
complains that 'there is no package with name "LTK"'. It does work if
I hit C-C C-C inside the asdf:operate line first, then C-C C-K to
compile the file - how come? Also I can't (use-package :ltk) because
it complains about conflicts.

Anyway, having done this, I then enter (hello-1) at the REPL, and it
pops up the wish window complete with button, then hangs up. I have to
manually kill the tk window, at which point the REPL prompt comes
back.

Any idea what I'm doing wrong here? Recommendations for another GUI?
(Though I'm fairly keen on Tk, due to the vector canvas, and would
like to get it working  if possible.) I'm using ActiveState's
ActiveTcl 8.4.9.0 and CLISP 2.33 from LIAB.

martin

From: Tayssir John Gabbour
Subject: Re: ltk hanging under lisp-in-a-box+clisp on windows
Date: 
Message-ID: <1111348465.191346.146880@f14g2000cwb.googlegroups.com>
Martin DeMello wrote:
> I finally managed to get ltk installed properly under lisp in a box
> (the liab docs should at least have a pointer to the 'getting asdf
> working under windows' docs - I had a reasonably hard time with it,
> and was cheerfully ignored in #lisp when I asked for help), but now
> I'm facing further problems actually getting stuff up and running.
I'm
> trying out the basic 'hello world' example:
>
> |(asdf:operate 'asdf:load-op :ltk)
> |
> |(defun hello-1 ()
> |  (ltk:with-ltk
> |      (let ((b (make-instance 'ltk:button
> |                              :master nil
> |                              :text "press me"
> |                              :command (lambda ()
> |                                         (format t "hello world!
> ~&")))))
> |        (ltk:pack b))))
>
> Firstly, this doesn't work when I hit C-C C-K inside emacs - it
> complains that 'there is no package with name "LTK"'. It does work if
> I hit C-C C-C inside the asdf:operate line first, then C-C C-K to
> compile the file - how come? Also I can't (use-package :ltk) because
> it complains about conflicts.
>
> Anyway, having done this, I then enter (hello-1) at the REPL, and it
> pops up the wish window complete with button, then hangs up. I have
to
> manually kill the tk window, at which point the REPL prompt comes
> back.
>
> Any idea what I'm doing wrong here? Recommendations for another GUI?
> (Though I'm fairly keen on Tk, due to the vector canvas, and would
> like to get it working  if possible.) I'm using ActiveState's
> ActiveTcl 8.4.9.0 and CLISP 2.33 from LIAB.

Perhaps it is your ISP? Testing it under one like AOL shows similar
problems, which don't exist with other ISPs.

The way to test this is by dropping your internet connection and seeing
if it works.
From: Edi Weitz
Subject: Re: ltk hanging under lisp-in-a-box+clisp on windows
Date: 
Message-ID: <uacoygiya.fsf@agharta.de>
On 20 Mar 2005 11:33:46 -0800, ·············@gmail.com (Martin DeMello) wrote:

> I finally managed to get ltk installed properly under lisp in a box
> (the liab docs should at least have a pointer to the 'getting asdf
> working under windows' docs - I had a reasonably hard time with it,

I thought LIAB was supposed to come with a working installation of
ASDF and ASDF-INSTALL?  But maybe my memory is wrong, I never tried
LIAB myself.

If you think something doesn't work as advertised I'm sure the
maintainers will be happy to get a bug report.

> and was cheerfully ignored in #lisp when I asked for help),

Judging from the #lisp logs at meme.b9.com it looks to me like a forum
very much biased towards SBCL/Linux... :)

> but now I'm facing further problems actually getting stuff up and
> running. I'm trying out the basic 'hello world' example:
>
> |(asdf:operate 'asdf:load-op :ltk)
> |
> |(defun hello-1 ()
> |  (ltk:with-ltk
> |      (let ((b (make-instance 'ltk:button
> |                              :master nil
> |                              :text "press me"
> |                              :command (lambda ()
> |                                         (format t "hello world!
> ~&")))))
> |        (ltk:pack b))))
>
> Firstly, this doesn't work when I hit C-C C-K inside emacs - it
> complains that 'there is no package with name "LTK"'. It does work
> if I hit C-C C-C inside the asdf:operate line first, then C-C C-K to
> compile the file - how come? Also I can't (use-package :ltk) because
> it complains about conflicts.

If you start with the definition of HELLO-1 right away it can't work
because this definition makes a reference to the symbol BUTTON in the
package "LTK" which isn't there until you load the LTK library.

The same happens if you compile the file with C-c C-k - the file
compiler reads the forms in the file, comes across the symbol
'LTK:BUTTON and doesn't know what to do with it.  Note that the file
compiler compiled the top-level form (ASDF:OPERATE ...) before reading
the definition of HELLO-1 - but it only compiled it, it didn't
/execute/ that form, and so the library wasn't actually loaded.

Take a look at the EVAL-WHEN special operator - it can be used to
enforce execution of top-level forms during compilation.

If you just want to try out the example simply LOAD the file - that
should be enough.

> Anyway, having done this, I then enter (hello-1) at the REPL, and it
> pops up the wish window complete with button, then hangs up. I have
> to manually kill the tk window, at which point the REPL prompt comes
> back.
>
> Any idea what I'm doing wrong here?

LTK has issues with certain Windows programs.  Tayssir reported a
problem with AOL, I have seen behaviour similar to the one you
describe with Babylon.  Try to disable all other programs and see if
it works then.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Martin DeMello
Subject: Re: ltk hanging under lisp-in-a-box+clisp on windows
Date: 
Message-ID: <_9m%d.743474$8l.512754@pd7tw1no>
Edi Weitz <········@agharta.de> wrote:
> 
> I thought LIAB was supposed to come with a working installation of
> ASDF and ASDF-INSTALL?  But maybe my memory is wrong, I never tried
> LIAB myself.
> 
> If you think something doesn't work as advertised I'm sure the
> maintainers will be happy to get a bug report.

Yep, I'll send one in (wanna be sure I'm not doing something stupid
first :))

> The same happens if you compile the file with C-c C-k - the file
> compiler reads the forms in the file, comes across the symbol
> 'LTK:BUTTON and doesn't know what to do with it.  Note that the file
> compiler compiled the top-level form (ASDF:OPERATE ...) before reading
> the definition of HELLO-1 - but it only compiled it, it didn't
> /execute/ that form, and so the library wasn't actually loaded.

Aaah! In retrospect, I should have seen that - I guess I was expecting
some magic to happen when it saw the load directive.

> Take a look at the EVAL-WHEN special operator - it can be used to
> enforce execution of top-level forms during compilation.

Thanks, will look that up. Would save me having to run the program from
the REPL each time too.

> LTK has issues with certain Windows programs.  Tayssir reported a
> problem with AOL, I have seen behaviour similar to the one you
> describe with Babylon.  Try to disable all other programs and see if
> it works then.

Thanks!!! This was indeed the problem, and I'd never have though of it
on my own. Turned out to be The Wonderful Icon
(http://www.thewonderfulicon.com/) that was causing it to hang - quit it
and everything works just fine.

martin
From: Peter Herth
Subject: Re: ltk hanging under lisp-in-a-box+clisp on windows
Date: 
Message-ID: <d28soo$fru$04$1@news.t-online.com>
Martin DeMello wrote:

> Thanks!!! This was indeed the problem, and I'd never have though of it
> on my own. Turned out to be The Wonderful Icon
> (http://www.thewonderfulicon.com/) that was causing it to hang - quit it
> and everything works just fine.

I have added it to the list of "troublemakers" in the Ltk documentation.

Have fun!

Peter

-- 
pet project: http://dawn.netcologne.de
homepage:    http://www.peter-herth.de
lisp stuff:  http://www.peter-herth.de/lisp.html
get Ltk here: http://www.peter-herth.de/ltk/