No, my first message may not have gotten through, as I posted immediately
after joining the mailing list.
I'll paraphrase the first message though:

I'm nesting with-events macros like this (eliding code that actually does
anything):
...
(with-events ()
  (:quit-event () t)
  (:mouse-motion-event  (:x x :y y)
      (when (<= y 20)  ; If the cursor is within the top 20 rows of pixels,
drop down a menu
          ... ; Drop down a menu 100 pixels high.
          (with-events ()
              (:quit-event () t)
              (:mouse-motion-event (:x x :y y)
                  (when (> y 100) ; If the cursor leaves the top 100 rows of
pixels, close the menu
                        ... ; Close the menu
                        (push-quit-event)))))))

My problem here was that the quit-event seems to stay in the event queue
after we leave the innermost with-events, also closing the outer with-events
as well. This problem seems to be sensitive to the amount of time the cursor
stays within the top 100 rows of pixels after we enter the inner
with-events. If the cursor moves in and immediately out
of the menu, the quit-event closes the outermost with-events. If I pause for
a second before leaving the menu, only
the innermost with-events responds to the quit-event.

I have side-stepped this problem by putting a "(block foo ..." around the
innermost with-event and using a "(return-from foo)" instead of a
"(push-quit-event)" to exit it. That works well, but I want to know if, by
nesting these with-event macros, my program may become broken in a future
version of lispbuilder-sdl.

Thanks


On Tue, Jul 15, 2008 at 5:12 PM, Justin Heyes-Jones <[EMAIL PROTECTED]>
wrote:

> Hi Stuart
>
> I didn't see your original message on the list, are you sure it got
> through?
>
> Justin
>
>
> On 15/07/2008, Stuart Overton <[EMAIL PROTECTED]> wrote:
> > Sorry to reply to my own message, but after trying a few things I've come
> up
> > with a variation on my original question.
> > Is there anything wrong with doing the following?:
> >
> > (with-events ()
> >    (:key-down-event (:key key)
> >         (block menu
> >            (with-events ()
> >                (:key-down-event (:key key)
> >                     (return-from menu))))))
> >
> > This seems to fix my problem, I just wanted to make sure that in doing
> this
> > I'm not screwing up the event queue or anything else.
> >
> > Thanks.
> >
> > p.s.: I love lispbuilder-sdl :)
> >
> > _______________________________________________
> >  application-builder mailing list
> >  [email protected]
> > http://www.lispniks.com/mailman/listinfo/application-builder
> >
> >
> _______________________________________________
> application-builder mailing list
> [email protected]
> http://www.lispniks.com/mailman/listinfo/application-builder
>
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to