Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix!bskendig From: bskendig@phoenix.Princeton.EDU (Brian Kendig) Newsgroups: comp.sys.mac.hypercard Subject: Re: Under lock and key: can't get screen to unlock in middle of handler Message-ID: <14541@phoenix.Princeton.EDU> Date: 15 Mar 90 05:38:57 GMT References: <8062@tank.uchicago.edu> Reply-To: bskendig@phoenix.Princeton.EDU (Brian Kendig) Organization: Starfleet Academy: Princeton University PQC PTC CIT EECS SCI Lines: 53 In article <8062@tank.uchicago.edu> gft_robert@gsbacd.uchicago.edu writes: >I've to a handler in one stack that will need to process a lot of cards (ca. >1000). I thought it might be nice to provide one of those little "bar >graphs" on screen which lets the user know how much has been done. A very good idea! I wish more programmers would thing of things like this... >The problem is: in my handler I'm going to each of the cards in question. In >the interests of speed and appearance I lock the screen on entering the >handler. So in my bar-graph-handler, I go back to the card I started on, >unlock the screen, fill in the bar graph, lock the screen again, and go back >where I was. Gaack! You're not *serious*, are you? If you visit one thousand cards, but stop at card 1 in between every stop, then you're making two thousand trips -- enough to make someone doubly impatient! Your handler shouldn't mess with the screen like that; it'll only slow things down. There are two obvious alternatives: - Don't bother locking the screen at all. Let each card visibly flip past. This way, the user will (we hope!) be satisfied that he knows something is going on, and if there's some ordered feature about the cards (say, sorted by last name, or by number), then the user might get some idea of how far along the computer is in its operation. - Lock the screen, and put a status indication in the message box. Locking the screen during a lot of card-flipping helps to speed it up somewhat. Put a message such as "xx% done..." into the box, and the user should be satisfied. >Or so I thought. The screen won't unlock for me and my graph doesn't get >drawn. Is there some trick to this? Can you lock and unlock the screen from >within a handler? The display is only updated when you change cards, *not* when you unlock the screen. Therefore, if you unlock the screen *before* going to the `status' card, then lock it again after getting there, your status display should work (although it'll be a card behind, but some reworking of your code should fix that). Hope this helps! << Brian >> -- | Brian S. Kendig \ Macintosh | Engineering, | bskendig | | Computer Engineering |\ Thought | USS Enterprise | @phoenix.Princeton.EDU | Princeton University |_\ Police | -= NCC-1701-D =- | @PUCC.BITNET | ... s l o w l y, s l o w l y, w i t h t h e v e l o c i t y o f l o v e.