EAO102@psuvm.psu.edu (Ernie Oporto) (06/29/91)
A little while ago, I posted an article requesting help for doing updates.
I only got two responses from people. While it may seem that this group
is not particularly hospitable to novice programmers, I'll try again, this
time, without the long source code.
My problem is this. I have ten windows, nine with a different pictures in
them. The tenth is a clock which runs fine. I have a problem with eight
of the nine windows in that when they are covered and then uncovered, they
do not update correctly. Only one of the nine updates, but the rest just
wont update. What I would like to see is how people address the problem of
updates. ANY simple little piece of source code for handling unique and
multiple windows would be of great aid. I do not own Inside Mac, or Mac
Revealed, but I own the Mac Programming Primer, so references from the
former two would not be of any help.
A few lines of code:
/*** DrawMyPicture ***/
DrawMyPicture (thePicture,pictureWindow)
PicHandle thePicture;
WindowPtr pictureWindow;
{
Rect myRect;
myRect=pictureWindow->portRect;
CenterPict(thePicture,&myRect);
SetPort(pictureWindow);
DrawPicture(thePicture,&myRect);
}
UpdateWindows()
{
if ((WindowPtr)gTheEvent.message==gStasisWindow)
DrawMyPicture(gStasisPict,gStasisWindow);
if ((WindowPtr)gTheEvent.message==gHeightWindow)
DrawMyPicture(gHeightPict,gHeightWindow);
if ((WindowPtr)gTheEvent.message==gWeightWindow)
DrawMyPicture(gWeightPict,gWeightWindow);
if ((WindowPtr)gTheEvent.message==gHairWindow)
DrawMyPicture(gHairPict,gHairWindow);
if((WindowPtr)gTheEvent.message==gEyesWindow)
DrawMyPicture(gEyesPict,gEyesWindow);
if ((WindowPtr)gTheEvent.message==gAgeWindow)
DrawMyPicture(gAgePict,gAgeWindow);
if ((WindowPtr)gTheEvent.message==gAddressWindow)
DrawMyPicture(gAddressPict,gAddressWindow);
if ((WindowPtr)gTheEvent.message==gPhoneWindow)
DrawMyPicture(gPhonePict,gPhoneWindow);
}
Ernie "SHOKK" Oporto();
{
_____) ______ _) _) EAO102@PSUVM.PSU.EDU
__ __ Student
______ ______ ___ ___ Computer Laboratory
__ __ Attendant of the
(_______ _ _ ________ _ _) _ _) PennState University
Center for Academic
} Computing