[comp.sys.mac.programmer] How to open two CWindows

bartels@haydn.kulesat.uucp (04/12/89)

I have problems with opening two colorwindows together. When I run 
mine program the two windows will appear on the screen but then I
had to resart mine computer. Below you will find mine program. If
you can help me, please send me a message because reading and reading
again Inside Macintosh V gives no solution.

The C program:

#include <Types.h>
#include <Memory.h>
#include <Quickdraw.h>
#include <Palette.h>
#include <Fonts.h>
#include <Events.h>
#include <Menus.h>
#include <Windows.h>
#include <TextEdit.h>
#include <Dialogs.h>
#include <Desk.h>
#include <OSUtils.h>
#include <ToolUtils.h>
#include <SegLoad.h>
#include <stdio.h>
#include <ioctl.h>

main()
{
CWindowPtr ImagePort,ConsolePort;
Rect Imagerect;
long int refCon;
CWindowRecord wRecord;


InitGraf(&qd.thePort);
InitWindows();


SetRect(&Imagerect,40,40,350,350);
ImagePort = (CWindowPtr) NewCWindow((Ptr) &wRecord,&Imagerect,"\pMijn eerste beeld",1,
                       documentProc, (WindowPtr) -1 ,0,refCon = 4);
SetRect(&Imagerect,370,40,570,400);
SetPort((GrafPtr) ImagePort);
ConsolePort = (CWindowPtr) NewCWindow((Ptr) &wRecord,&Imagerect,"\pConsole",1,
                       documentProc, (WindowPtr) -1 ,0,refCon = 4);
while(! Button());

}

Thanks for your attention,

					Yours sincerly,
								
									
					Rudi Bartels
					KU Leuven 
					Faculteit der Toegepaste Wetenschappen
					ESAT-MI2
					Kard. Mercierlaan 94
					3030 Heverlee
					Belgium
					email: bartels@kulesat.uucp
					Fax: 32-16-221855