What I would do is something like the following (this will also give you a better granularity on pen events):
case penDownEvent:
if (RctPtInRectangle(eventP->screenX,
eventP->screenY, &gDrawRect))
{
Coord gX = eventP->screenX;
Coord gY = eventP->screenY;Boolean penDown = true;
while (penDown) {
Coord newX, newY;EvtGetPen(&newX, &newY, &penDown);
if (RctPtInRectangle(newX, newY, &gDrawRect)) {
WinDrawLine(gX, gY, newX, newY);
gX = newX;
gY = newY;
}
else
penDown = false;
}
}break;
You don't need the penMoveEvent or penUpEvent handlers with this code...
----
Tom Frauenhofer, [EMAIL PROTECTED]
http://www.beret.com
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
