From: charlie
Subject: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118327826.365743.198280@g49g2000cwa.googlegroups.com>
Hi,
    I'm using ltk on win32 and linux platforms and it works very well
on both. Unfortunatelly there is a small but significant problem on
win32 (XP).

When you first start your ltk app you must manually give it an event of
some sort. I usually give it a mouse focus event but as I recall from
my testing a simple mouse-over event is sufficient. If the window
doesn't recieve an event before ltk reaches the event loop (i.e. during
initilisation) then the window will not respond at all and you have to
kill it.

I've contacted Peter Herth about it but he doesn't have access to a
windows box so he can only sympathise. I've tried having ltk send the
initial window a grab-focus command but it makes no difference. I was
wondering if anyone else is using ltk on windows and if they have (or
haven't) experienced a similar problem.

Cheers
Charlie.

From: Edi Weitz
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <umzpz1tfv.fsf@agharta.de>
On 9 Jun 2005 07:37:06 -0700, "charlie" <···············@gmail.com> wrote:

>     I'm using ltk on win32 and linux platforms and it works very
> well on both. Unfortunatelly there is a small but significant
> problem on win32 (XP).
>
> When you first start your ltk app you must manually give it an event
> of some sort. I usually give it a mouse focus event but as I recall
> from my testing a simple mouse-over event is sufficient. If the
> window doesn't recieve an event before ltk reaches the event loop
> (i.e. during initilisation) then the window will not respond at all
> and you have to kill it.
>
> I've contacted Peter Herth about it but he doesn't have access to a
> windows box so he can only sympathise. I've tried having ltk send
> the initial window a grab-focus command but it makes no
> difference. I was wondering if anyone else is using ltk on windows
> and if they have (or haven't) experienced a similar problem.

LTK on Win32 is notorious for having problems with other Windows apps,
including but not limited to Babylon and some AOL thingy.

You might want to try without any other programs and extensions loaded
and see if your problem goes away.  It might also be worthwhile to
search comp.lang.lisp via Google Groups for similar problem
descriptions.

HTH,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: charlie
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118330885.988676.296300@f14g2000cwb.googlegroups.com>
Yes, there do seem to be some odd issues. How strange that I missed
those posts. Thanks for that, I'll give it a try on a cleaner machine.

Cheers
Charlie.
From: Thomas F. Burdick
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <xcvacly4p8w.fsf@conquest.OCF.Berkeley.EDU>
"charlie" <···············@gmail.com> writes:

> Yes, there do seem to be some odd issues. How strange that I missed
> those posts. Thanks for that, I'll give it a try on a cleaner machine.

And if you have some Windows programming experience, it would be
extremely helpful if you could try to figure out why having AOL
running causes this, and if there's anything LTk can do to avoid the
problem.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | Free Mumia Abu-Jamal! |
     ,--'    _,'   | Abolish the racist    |
    /       /      | death penalty!        |
   (   -.  |       `-----------------------'
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: charlie
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118396450.460270.128060@o13g2000cwo.googlegroups.com>
Ok I think I just solved my problem(s). It's a simple little variable
on the wrong side of a close bracket type in the function read-event.
Here's the official version:
(defun read-event (&key (blocking t))
  (let ((pending (pop *event-queue*)))
    (unless pending
      (when (or blocking (can-read *wish*))
	(setf pending (read-preserving-whitespace *wish* nil nil)))
      pending)))

Observe that the return of pending is inside the unless so if pending
is not null when it's popped the result will be null.
And now my version:

(defun read-event (&key (blocking t))
  (let ((pending (pop *event-queue*)))
    (unless pending
      (when (or blocking (can-read *wish*))
	(setf pending (read-preserving-whitespace *wish* nil nil))))
    pending))

As I say this solves my problem but as for AOL I don't rightly know, I
don't have it on any of my machines. I'll do what I can but I don't
know how I can investigate this. Sorry. Give me as much info as you can
anyway maybe I can find something.

Cheers
Charlie.
From: Wade Humeniuk
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <t2oqe.58492$9A2.21844@edtnps89>
charlie wrote:

> 
> (defun read-event (&key (blocking t))
>   (let ((pending (pop *event-queue*)))
>     (unless pending
>       (when (or blocking (can-read *wish*))
> 	(setf pending (read-preserving-whitespace *wish* nil nil))))
>     pending))
> 

A simpler version might be..

(defun read-event (&key (blocking t))
   (or (pop *event-queue*)
       (when (or blocking (can-read *wish*))
         (read-preserving-whitespace *wish* nil nil))))

Wade
From: Wade Humeniuk
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <l6oqe.58494$9A2.36718@edtnps89>
charlie wrote:

>
> (defun read-event (&key (blocking t))
>   (let ((pending (pop *event-queue*)))
>     (unless pending
>       (when (or blocking (can-read *wish*))
>     (setf pending (read-preserving-whitespace *wish* nil nil))))
>     pending))
>

A simpler version might be..

(defun read-event (&key (blocking t))
   (or (pop *event-queue*)
       (when (or blocking (can-read *wish*))
         (read-preserving-whitespace *wish* nil nil))))

Wade
From: Wade Humeniuk
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <ypoqe.58502$9A2.11843@edtnps89>
charlie wrote:

 >
 > (defun read-event (&key (blocking t))
 >   (let ((pending (pop *event-queue*)))
 >     (unless pending
 >       (when (or blocking (can-read *wish*))
 >     (setf pending (read-preserving-whitespace *wish* nil nil))))
 >     pending))
 >

A simpler version might be..

(defun read-event (&key (blocking t))
   (or (pop *event-queue*)
       (when (or blocking (can-read *wish*))
         (read-preserving-whitespace *wish* nil nil))))

Wade
From: Peter Herth
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <d8d05d$9tk$03$1@news.t-online.com>
charlie wrote:
> Ok I think I just solved my problem(s). It's a simple little variable
> on the wrong side of a close bracket type in the function read-event.
> Here's the official version:
> (defun read-event (&key (blocking t))
>   (let ((pending (pop *event-queue*)))
>     (unless pending
>       (when (or blocking (can-read *wish*))
> 	(setf pending (read-preserving-whitespace *wish* nil nil)))
>       pending)))
> 
> Observe that the return of pending is inside the unless so if pending
> is not null when it's popped the result will be null.
> And now my version:
> 
> (defun read-event (&key (blocking t))
>   (let ((pending (pop *event-queue*)))
>     (unless pending
>       (when (or blocking (can-read *wish*))
> 	(setf pending (read-preserving-whitespace *wish* nil nil))))
>     pending))
> 
> As I say this solves my problem but as for AOL I don't rightly know, I
> don't have it on any of my machines. I'll do what I can but I don't
> know how I can investigate this. Sorry. Give me as much info as you can
> anyway maybe I can find something.

How emberassing... I knew that something was goofy with my function, but
could not point to it... To my defense: the "pending" was indented in
the position it is in the correct version, thats why I didn't see it, 
not counting the parenthesises or reindenting the function... Now if
that isn't the perfect flamebait for a Python vs Lisp syntax
discussion :)

Thanks for the fix and glad to hear your problems are resolved.

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/
From: charlie
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118648208.226093.216190@g47g2000cwa.googlegroups.com>
You're welcome, happy to help.

Charlie.
From: charlie
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118659947.326290.3590@f14g2000cwb.googlegroups.com>
Now that I test more throughly I've found that actually the hanging
problem isn't solved. My mouse is set to jump about the screen
following new windows and so, depending on rodent accuracy, the window
gets its event before the initialization script runs out. Grrrr.
Anyway glad I found a bug even if it's not *the* bug.

Charlie
From: charlie
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <1118668176.682992.170120@f14g2000cwb.googlegroups.com>
Googling comp.lang.tcl would suggest that enabling multithreading (at
tcl core compile time) solves alot of hanging type problems in
tcl/wish. I'm not going to embark on this yet (linux is still my
primary OS) but maybe sometime in the future.

Charlie.
From: Wade Humeniuk
Subject: Re: Ltk on win32 hanging at startup.
Date: 
Message-ID: <2Eqqe.44796$on1.43821@clgrps13>
charlie wrote:

 >
 > (defun read-event (&key (blocking t))
 >   (let ((pending (pop *event-queue*)))
 >     (unless pending
 >       (when (or blocking (can-read *wish*))
 >     (setf pending (read-preserving-whitespace *wish* nil nil))))
 >     pending))
 >

A simpler version might be..

(defun read-event (&key (blocking t))
   (or (pop *event-queue*)
       (when (or blocking (can-read *wish*))
         (read-preserving-whitespace *wish* nil nil))))

Wade