[racket] Racket GUI with Xlib

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Nov 27 12:17:04 EST 2012

On Tue, Nov 27, 2012 at 11:14 AM, Laurent <laurent.orseau at gmail.com> wrote:
> On Tue, Nov 27, 2012 at 6:05 PM, Robby Findler <robby at eecs.northwestern.edu>
> wrote:
>> Well, this is one possible way:
>> (paramterize ([current-eventspace gui-eventspace]) (queue-callback
>> (lambda () (send f popup-menu menu2 100 100))))
> Just did that, and now it says #t for being in the gui-eventspace, but it
> still has the same behavior otherwise (i.e., the popup menu does not show up
> and then the button does not work anymore).

Perhaps the handler thread of the gui-eventspace is already busy doing

>> But probably it would be better to make sure that the callback that is
>> handling the keystroke be on the gui-eventspace in the first place.
> I'm not sure what you mean here. Is that different from queue-callback?

When an event comes into the system it has a frame associated with it,
from the OS. DrRacket looks at that frame, finds its eventspace, finds
the main handler thread, and then uses that thread to handle the
callback. (If you have multiple eventspaces going, it is generally a
good idea to know which events go to which eventspaces and what
different eventspaces are doing at different times.)


Posted on the users mailing list.