Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!gsbacd.uchicago.edu!gft_robert From: gft_robert@gsbacd.uchicago.edu (opcode ranger) Newsgroups: comp.sys.mac.hypercard Subject: Re: what message is sent when a palette is closed? Message-ID: <1991Feb27.122238.1@gsbacd.uchicago.edu> Date: 27 Feb 91 18:22:38 GMT References: <2727@beguine.UUCP> <1991Feb27.040911.2064@kumr.lns.com> Sender: news@midway.uchicago.edu (News Administrator) Organization: University of Chicago Lines: 40 In article <1991Feb27.040911.2064@kumr.lns.com>, kamins@kumr.lns.com (Scot Kamins) writes: >>HOW do I tell when the user closes the palette? > > on closePalette > put "Palette is closed!" > end closePalette > > Strangely enough, HyperCard sends closePalette to the current card when you > (yes) close a palette! :-} I found this out this very afternoon! > Seriously! Ah, well. That's not noted in the Script Guide is it? In any case, in a stack I'm writing I end up opening my palette everytime I enter a certain background, and closing it (if it hasn't been closed, which I determine with the "there is" operator) everytime I leave the background. My question is this: is there any memory penalty for repeatedly opening an closing a palette? I checked on this by writing a script which did this, and put the memory difference before opening the palette and after closing it. On the first time there was less memory in the heap after closing the palette than there was before opening it; each sucessive iteration caused no memory loss. So can one cause a crash if one opens and closes palettes too often? I doubt it, particularly since an XMCD should clean up after itself. Perhaps the initial memory loss is caused by some resources (e.g. the XCMD itself) being loaded in the heap? Any info much appreciated (since I don't want my client's stack to start crashing! :->). Robert -- ============================================================================ = gft_robert@gsbacd.uchicago.edu * generic disclaimer: * "It's more fun to = = * all my opinions are * compute" = = * mine * -Kraftwerk = ============================================================================