Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!jason From: jason@ux1.cso.uiuc.edu (Jason) Newsgroups: comp.sys.mac.programmer Subject: Re: Dialogs vs Windows Message-ID: <1990Sep6.171353.12996@ux1.cso.uiuc.edu> Date: 6 Sep 90 17:13:53 GMT References: <1259@meaddata.mead.UUCP> Organization: University of Illinois at Urbana Lines: 32 rubin@mead.UUCP (Daniel Rubin) writes: >Are the opening and closing of Dialogs victimized by memory fragmentation >like the opening and closing of Windows are ???? Yes, dialogs are windows (windows with some additional data appended to the root window structure/record). >In other words... Will I run in to memory fragmentation proglems if I >open one main window and through out the course of the program execution >there are many many dialogs ???? Perhaps. If you have a program which uses various windows/dialogs at varying times, one of the best methods is to allocate the windows and dialogs just after the other standard initializations: 1) maximize the application's zone 2) use MoreMasters() to allocate the number of master pointers needed 3) initialize the Toolbox * 4) use NewWindow(), NewDialog(), etc. to create the as many windows as you need. 5) (Forgive me if I have left anything out). In the case of a modal dialog, memory fragmentation is not such a big concern since the dialog can be disposed of as soon as the user sends it away. Here the concern would simply be memory availability at the time the dialog needs to be created. -- | | |====================| | | | Jason Watts | \ |\ |\ \ | (jazzin@uiuc.edu) |