[Gambas-devel] Hooking the event loop

tobi tobias at ...692...
Fri May 25 20:48:00 CEST 2012


On Fri, 25 May 2012, Benoît Minisini wrote:
> Le 20/05/2012 22:21, tobi a écrit :
> > Hi,
> >
> > I saw in gambas.h that I'm able to install a hook for the event loop. This simply is a function to
> > be called by the native event loop, as I saw in gb.qt4, right? Is there any policy to respect when I
> > install such a hook (like saving the former hook and calling it, too to not turn off any essential
> > attributes of other components)?
> > Of course, I wouldn't fiddle around with that without a reason: I have a module that will wait for a
> > key press and from then on continuously raise events until a key release occurs. I need a point
> > where it makes sense to install a function that periodically dispatches that event. You see, it is
> > handled by logic so I have no fd or something to GB.Watch()...
> >
> > Regards,
> > Tobi
> >
> 
> Actually it's not a hook. It must be a full implementation of an event loop.
> 
> The Gambas interpreter has an internal event loop. GUI tookits usually 
> implement their own event loop, that is of course not compatible with 
> the Gambas one. So, by specifying the 'LOOP' hook, you tell the 
> interpreter not to use its own event loop, but let the toolkit use its 
> own one.
> 
> I don't give you all the detail. It is more complex than that, because 
> the toolkit event loop must be modified so that it can handle Gambas 
> timers and file descriptor watches.
> 
> Regards,
> 
> -- 
> Benoît Minisini
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel
> 

That was what I presumed. I don't need that anymore as I have GB.Every() now.





More information about the Devel mailing list