Article View: comp.windows.interviews
Article #228Add Graphics Dynamically Erases Previous Ones.
From: Chittathoor M. Sriram
Date: Wed, 12 Aug 1992 00:52
Date: Wed, 12 Aug 1992 00:52
44 lines
1399 bytes
1399 bytes
Dear IV users,
I presently have a class derived from a Glyph and Handler.
I redefined the draw member function in my class to Draw some
filled rectangles. Also whenever a DownEvent occurs I keep
adding filled rectangles but what is happening is although
the new FilledRectangle is displayed properly, The old one is
erased. I am not sure where I am doing a mistake.
Any help is appreciated.
Thanks for your time.
My Code:
class MyClass : public Glyph {
void draw( .................);
}
MyClass::draw (.......) {
static incr = 0;
canvas->fill_rect (140+incr, 5, 160+incr, 10);
incr += 25;
}
MyClass::DownHandle {
patch->redraw();
}
I have enclosed MyClass in a Patch and called it patch.
DownHandle is called whenever I detect a button_down event on the Glyph.
Though the Filled Rectangles appear on the screen. All the previous
ones disappear.
Sriram
Technical Details
Message-ID:
<9208120052.AA19202@sparc0.brc.uconn.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!brc.uconn.edu!sriramShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!brc.uconn.edu!sriram From: sriram@brc.uconn.edu (Chittathoor M. Sriram) Subject: Add Graphics Dynamically Erases Previous Ones. Message-ID: <9208120052.AA19202@sparc0.brc.uconn.edu> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Wed, 12 Aug 1992 00:52:45 GMT Lines: 44