In my work on the graphics inset I find myself with a need for internal
events, namely to announce internally that an image has been loaded. The
problem starts when I want to do the image loading in a second
thread/fork/whatever, since LyX isn't necessarily (read: isn't) thread
safe, I can't just use a plain signal/slot mechanism, but rather need to
do this signal from the main loop.
My current plan calls for a toolkit dependant SendEvent() that will send
the event to the main gui loop, and by some magic this will call the
correct event handler (possibly by signal/slot) inside the main thread.
This will allow me to call the insets, notify them that the image is here
and they can update the image, ask for a redraw if appropriate and so on.
Is this idea acceptable?
If yes, can someone suggest the magic by which the SendEvent() and the
main loop will know what signal/slot to fire?
My idea is to have something like: SendEvent(signal_handler), but then how
the SendEvent and the mainloop transfer between them the handler? How can
I implement that in X(forms)?
P.S. The background running class in support is not working (or at least,
didnt work when I last tried to use it for background work), It appears
that the road to the GraphicsInset is riddled with hard work for the
supporting foundations.
--
Baruch Even
http://techst02.technion.ac.il/~sbaruch/ (My Site)
http://www.redrival.com/jindor/ (My brothers AD&D site)
" Learn to laugh ... it's the path to true love! "
- The Angel in the movie Michael