Angus Leeming wrote: > We're talking about /exactly/ the same thing. Well I said I have the impression when I read your last post ;)
> I /want/ to invoke startLoading() from within Inset::draw. > > I /do not want/ to do it without a little care. > > I envisage something like: > > Image::startLoading(Inset * inset) { > // call REALLYstartLoading(inset) in 2 secs time > startTimer(2, inset REALLYstartLoading) > } > > Image::REALLYstartLoading(Inset * inset) { > if (!inset->isVisible()) > return; > > // load it > .. > } > > Similarly in BufferView::updateInset(Inset * inset) { > if (!inset->isVisible()) > return; > > inset->draw(); > } What I miss in all this is the "rebreaking" where would you put that here? > So, my question again. What's the equivalent of "Inset::isVisible()". I /do/ > know the BufferView. Ok. No we don't have a isVisible function right now and I don't think this is easy to make as the "visibility" depends on the x,baseline values passed as parameters to draw, which could change if I have to rebreak the text after the loading. You could have a look at the tabular.C or insettext.C draw functions. I just draw the visible parts there, but for a graphics file with a fixed hight it could be as easy as "if baseline+graphics_height > 0 then draw". > You know, /if/ there were such a method or way of ascertaining this > information, then BufferView::updateInset() should also use it to not redraw > things that aren't visible. That would stop all those "the cursor jumps all > over the place as the graphics insets are loaded" problems that people moan > about now. > > void BufferView::updateInset(Inset * inset) { > if (!inset->isVisible()) > return; > > inset->draw(); > } I don't think we can do this. > Capito? Sure I hope you too. Jug P.S.: Is it only an impression or do I get mail doubled again :) -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED] Kravoglstrasse 4 Tel/Fax: +39 0471 564172 - +39 0471 564122 I-39100 Bozen Web: http://www.lyx.org/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._