>I have found out that if I remove the FrmEraseForm the problem goes away,
>which is lucky because I have realised that I don't actually need the
>FrmEraseForm.

That sounds like the root cause of the problem.  You shouldn't be calling
FrmEraseForm since that routine is really only for use when the form is
going away: being closed, deleted, done with.  It isn't something you do as
a prelude to drawing.  FrmEraseForm deletes the menus, restores the bits of
the underlying form (if any were saved), and clears out the status of which
field had focus, and other such things.  Perhaps it should have been called
FrmNukeFormFromDisplayBecauseItIsAboutToBeDeleted.


>The docs don't indicate anything to me that I shouldn't do a FrmEraseForm
>then a FrmDrawForm (except that FrmDrawForm does an erase in >3.5 OS).

True; the docs don't tell you much about the function.  I guess that's
because it is rarely used in practice.

If your real goal is to erase any stray drawing that had taken place, i.e.
do a full visual wipe and refresh of the form's contents, call
WinEraseRectangle and then FrmDrawForm. Usually it is up to each form
object to clear out its bounds as necessary, and usually there isn't
anything scribbling on the form outside of the boundaries of the form
objects. (If there is, consider using a gadget particularly since in 3.5
and higher the extended gadgets tell you when you need to redraw
yourself... in older systems occasionally you might not know that you would
need to redraw that stuff and there wasn't a way to tell you to.)

-David Fedor
PalmSource, Inc.

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to