2012/4/28 Syll
<syll-dev@laposte.net>
Le Mon, 12 Mar 2012 21:51:02 +0100
Syll <syll-dev@laposte.net> a écrit :
> Hello
>
> Is it possible to add an event in the ltk event queue from another
> thread ?
Possible? Yes. A good idea? Maybe not.
There is an ltk-connection object in *wish*, which has an event-queue slot, containing any buffered events. If you were to add events there, they would be processed as though they had come from the wish process.
However, pushing things onto that list won't cause the Ltk main loop to process them; for that, its call to read-preserving-whitespace must return. If you know your implementation well enough, this should be enough to get you going. If you need more help, you probably shouldn't be messing with the event queue.
>
> I can put events in a queue and use (after ...) to read it
> periodically in the ltk thread, but it would be easier and more
> efficient to use the ltk event queue directly.
>
> Thank you
>
> Syll
Is this possible ?