On Wed, 22 Nov 2000, Andre Poenitz wrote:
> > 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.
> > ...
> > Is this idea acceptable?
>
> "toolkit dependent method" does not really sound nice. Why don't you just
> check every once in a while (e.g. if the picture has to be redrawn anyway,
> whether the image has been loaded in the mean time?
Toolkit dependent is what we do in the GUII, it shouldn't be too hard to
add a SendMessage method to the GUII abstraction mechanism, that is the
actual message sending is SD (System Dependent), in windows we send it in
one method and in X in another (possibly with variations in GTK/QT).
Checking everytime I need to draw is a waste of cycles, asyncronous work
is far superior, it causes reduced cpu usage and better responsiveness for
the user. Also, consider the much requested feature to watch the file and
when it changes to update the lyx inline display. This is a little used
feature, but for those who need it, it has better usability, without
asyncronous messages I'll be forced to check on each redraw if the file
changes, which is obviously a waste.
All in all, I believe that this internal message sending is usefull for
the whole of lyx, especially if we would want one day to do more stuff
asyncronously (like exporting files).
A current possible hack is to use the idle cycles of the gui to check the
completion every now and then. This is not optimal but can work for the
meantime. However the better solution is to have internal messaging.
--
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