Thread View: comp.windows.interviews
2 messages
2 total messages
Started by Paul Shannon
Sun, 20 Dec 1992 23:14
preview.c: damaging questions
Author: Paul Shannon
Date: Sun, 20 Dec 1992 23:14
Date: Sun, 20 Dec 1992 23:14
41 lines
1903 bytes
1903 bytes
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.
There are allusions to these functions at a few points in the
Reference Manual and in other iv-related papers I've collected, but
nowhere have I've been able to find anything like an explanation
of what they really do, and why. And I'm further confused about
the possibly related functions, draw and redraw.
I gather from the August '90 paper "Glyphs: Flyweight Objects for
User Interfaces" that the iv approach is to "...build objects that
will draw themselves whenever necessary". I've read the Reference
Manual countless times now, and I still can't find any explanation
of this mechanism. Who decides when it's necessary to redraw?
How can this be forced?
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'll be grateful for any help on this.
Also, if the source for the editor described in the "Glyphs..."
article is available, I'd sure like to take a look at it.
Thanks.
- Paul
Re: preview.c: damaging questions
Author: 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
==========================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads