Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!bc From: bc@Apple.COM (bill coderre) Newsgroups: comp.sys.mac.hypercard Subject: Re: How can I dim text? Keywords: dim text, HyperCard, Message-ID: <46801@apple.Apple.COM> Date: 25 Nov 90 17:31:59 GMT References: <1844@diemen.utas.edu.au> <46466@apple.Apple.COM> <1198@prlhp1.prl.philips.co.uk> Organization: Apple Computer Inc., Cupertino, CA Lines: 53 In principle, there is a simple and nice way to dim text: provide a "dim" font, and switch to and from it as needed. Here's some notes on doing that. First, you have to make a dim font. I have seen a font "ChicagoGrey" floating around, but I don't know its legal status. Nevertheless, you could use any font editor to make one of your own, and install it into whichever stacks need it. The details of this are left as an excercise to the Reader. Second, although the Hypertalk statement "set the textfont of to " works fine, it can actually be very slow, for reasons only the HC team understands. Therefore, here are three suggestions: * If you are going to update a "button panel" frequently, consider wrapping a "lock screen" and an "unlock screen" around the whole mess. It will speed things up quite a bit. * Use something like the following to change the button status: on setEnabled oname status if (the textfont of oname is "Chicago") is status then return else if status then set the textfont of oname to "Chicago" else set the textfont of oname to "ChicagoGrey" end if end setEnabled The first line checks to see if the object has the right font already, and if so exits without doing anything. This hack also greatly increases the speed of updates. * Don't update the status of any buttons that "obviously" should not have changed. Don't hurt yourself doing this, though. I once figured I'd optimize the updates through the World's Most Complex If Statement, but it didn't help. ALL of the slowness came from the "set textfont" statement. By following these precautions, you will have speedy updates. Last, you need this handler in your buttons: on mouseDown if the textfont of this button is "Chicago" then... end mouseDown Embellishments optional. Tartar sauce 35 cents extra. If you need more help, drop me a line. bill coderre private consultant for a day