Newsgroups: comp.sys.apple2 Path: news.weeg.uiowa.edu!news.uiowa.edu!hobbes.physics.uiowa.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!wupost!howland.reston.ans.net!usc!cs.utexas.edu!uwm.edu!caen!batcomputer!cornell!rochester!rit!isc-newsserver!ritvax.isc.rit.edu!EAF2239 From: eaf2239@ritvax.isc.rit.edu Subject: CopyPix trouble Message-ID: <1993Mar4.022725.25275@ultb.isc.rit.edu> Sender: news@ultb.isc.rit.edu (USENET News System) Nntp-Posting-Host: vaxc.isc.rit.edu Reply-To: eaf2239@ritvax.isc.rit.edu Organization: Rochester Institute of Technology Date: Thu, 4 Mar 1993 02:27:25 GMT Lines: 157 About three months ago, I posted about a problem I had been having with the tool call "CopyPixels" from Orca C 1.4. In frustration, I droped the project. Then GNO. Inspired by GNO's ability to fork functions, I re-opened the book on my project and am VERY pleased with what GNO has alowed me to do. Unfortunatly, I never solved the original problem. So I hacked the code down to a simple desk top program that creats a window and an update function (using copypixels) just like the largr program to see if I could trace out the problem with out any other stuff going on. It still doesn't seem to work. No update! It should update the window with a line of black dashes. (4 pix of black , 4 pix of white, and so on) Any clues? I have included the program here: #include #include #include #include #include #include #include #include #include #include #include #include #include #define file_Quit 256 /*---------------------- Function Prototypes ----------------------------*/ void main(void); void InitMenus(void); void HandleMenu(int menuNum); int MakeGraphicWindow(char Title[]); void ContentUpdate(void); /*----------------------- Global Variables ------------------------------*/ ParamList wParams = { 78, 0xDDA7, NULL, 0, 0, 615, 25, 188, NULL, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, NULL, NULL, NULL, 25, 0, 188, 615, NULL, NULL }; int done; WmTaskRec lastEvent; Rect tempRect; LocInfo LocInfoRec; char Pic[16] = {255, 255, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 0, 0}; /*-----------------------------------------------------------------------*/ void main(void) { int event; startdesk (640); InitMenus (); ShowCursor (); lastEvent.wmTaskMask = 0x1FFFL; done = FALSE; MakeGraphicWindow("\pThis Is Only A Test"); tempRect.v1 = 0; tempRect.h1 = 0; tempRect.v2 = 10; tempRect.h1 = 128; LocInfoRec.ptrToPixImage = Pic; LocInfoRec.portSCB = 128; LocInfoRec.width = 16; LocInfoRec.boundsRect.v1 = 0; LocInfoRec.boundsRect.h1 = 0; LocInfoRec.boundsRect.v2 = 1; LocInfoRec.boundsRect.h1 = 64; do { event = TaskMaster (0x076E, &lastEvent); switch (event) { case wInSpecial: break; case wInMenuBar: HandleMenu ((int)lastEvent.wmTaskData); break; default: break; } } while (!done); enddesk (); } /*-----------------------------------------------------------------------*/ void InitMenus(void) { InsertMenu (NewMenu (">> Edit \\N3\r" /* create the edit menu */ "--Undo\\N250V*Zz\r" "--Cut\\N251*Xx\r" "--Copy\\N252*Cc\r" "--Paste\\N253*Vv\r" "--Clear\\N254V\r" ".\r"), 0); InsertMenu (NewMenu (">> File \\N2\r" /* create the file menu */ "--Open\\N258*Oo\r" "--Close\\N255V*Ww\r" "--Quit\\N256*Qq\r" ".\r"), 0); InsertMenu (NewMenu (">>@\\XN1\r" /* create the Apple menu */ "--About This Program\\N257V\r" ".\r"), 0); FixAppleMenu (1); /* add desk accessories */ FixMenuBar (); /* draw the completed menu bar */ DrawMenuBar (); } /*-----------------------------------------------------------------------*/ void HandleMenu(int menuNum) { switch (menuNum) { case file_Quit: done = TRUE; break; default: break; } HiliteMenu(FALSE, (int) (lastEvent.wmTaskData >> 16)); } /*-----------------------------------------------------------------------*/ int MakeGraphicWindow(char Title[]) { struct PictRecord *temp; wParams.wTitle = Title; wParams.wContDefProc = (VoidProcPtr)ContentUpdate; wParams.wPlane = (GrafPortPtr)topMost; SetPort(NewWindow(&wParams)); } /*-----------------------------------------------------------------------*/ #pragma databank 1 void ContentUpdate(void) { CopyPixels(&LocInfoRec, GetPort(), &LocInfoRec.boundsRect, &tempRect, 0, GetVisHandle()); } #pragma databank 0 Thanx for the help! Ethan Funk (EAF2239@ritvax.isc.rit.edu)