Article View: comp.windows.interviews
Article #1225Re: preview.c: damaging questions
From: Andre Mueller
Date: Mon, 21 Dec 1992 18:46
Date: Mon, 21 Dec 1992 18:46
59 lines
1854 bytes
1854 bytes
In article <PSHANNON.92Dec20181421@iapetus.cv.nrao.edu>, pshannon@iapetus.cv.nrao.edu (Paul Shannon) writes:
|> I'm trying to learn more InterViews by extending the example program
|> "preview.c" so that it's more nearly a true editor. I didn't get very
|> far in this before I got stuck on the concepts of damage and repair.
|> At least that's where I think I'm stuck.
|>
I've had the same problem.
|> I'd like to find an explanation, and I'd like to solve this specific
|> problem:
|>
|> void DocumentView::erase ()
|> {
|>
|> printf ("in DocumentView::erase ");
|> printf ("glyphs in buffer: %d\n", page_->count ());
|>
|> for (GlyphIndex i=0; i < page_->count (); i++)
|> page_->remove (i);
|>
|>
|> Having removed these glyphs, what do I do to see force the screen
|> update?
|>
I've solved the problem as follows:
DocumentView has to be derived from Patch (instead from MonoGlyph)
and an update function could be defined as
DocumentView::update() {
page_->repair();
reallocate();
redraw();
}
Now you need only to call this update function in your erase function:
...
for (GlyphIndex i=0; i < page_->count (); i++)
page_->remove (i);
update();
...
I hope this will help you.
--
==========================
Andre' Mueller
Nestler electronics GmbH
D-7630 Lahr/Schwarzwald
Tel: +49(0)7821 284361
E-mail: amr@nestler.DE
==========================
Technical Details
Message-ID:
<2110@nestler.DE>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!nestler!amrReferences:
<PSHANNON.92Dec20181421@iapetus.cv.nrao.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!Germany.EU.net!nestler!amr From: amr@nestler.DE (Andre Mueller) Newsgroups: comp.windows.interviews Subject: Re: preview.c: damaging questions Message-ID: <2110@nestler.DE> Date: 21 Dec 92 18:46:32 GMT References: <PSHANNON.92Dec20181421@iapetus.cv.nrao.edu> Sender: news@nestler.DE Distribution: comp Organization: Nestler Electronics (Germany) Lines: 59