Path: utzoo!attcan!uunet!cadnetix.COM!cadnetix!pem From: pem@cadnetix.COM (Paul Meyer) Newsgroups: comp.sys.mac.hypercard Subject: Re: freezing or disabling buttons Summary: Make the scripts do the work piecemeal Keywords: buttons disabled quickly Message-ID: <3014@cadnetix.COM> Date: 17 Jun 88 17:55:33 GMT References: <31622@yale-celray.yale.UUCP> Sender: news@cadnetix.COM Reply-To: pem@cadnetix.COM (Paul Meyer) Organization: Cadnetix Corp., Boulder, CO Lines: 66 [] Suggestion 1: Make the link buttons' scripts check for the popped-openness of the fields that should obscure them before doing their jumps: on mouseup -- link unless obscured if not the visible of field xyzzy go to card 71077345 end mouseup Suggestion 2: Have you thought about using a global Hypertalk variable, or a hidden background field, to control the *buttons'* scripts? This would also simplify the logic for determining when to disable the buttons, too: (pardon any syntax problems--I don't do Hypertalk that often.) on mouseup -- pop up my field if the visible of field xyzzy then hide field xyzzy put field popcount - 1 into field popcount else show field xyzzy put field popcount + 1 into field popcount endif end mouseup on opencard -- on entering a card of this background, close all the ~ popups. hide field xyzzy hide field plugh hide field dwarf put 0 into field popcount end opencard on mouseup -- link if no fields popped up if field popcount < 1 go to card 71077345 end mouseup Suggestion 2': Perhaps you want the link buttons to still be creatable by the "create link" option. In this case, you could follow method 2 but patch the "go" command at the background level. (This is where my lack of recent hyperhacking shows badly, but a few minutes with the manuals should make this work.) Leave the opencard and popup-button handlers alone, but put this in the background script: on go alfa bravo charlie delta echo foxtrot golf hotel if (alfa = "to") and (bravo = "card") and (charlie = "id") -- or ~ some such nonsense--check a "create link"'ed button ~ for what the syntax it uses is if field popcount < 1 go to card id delta else pass go alfa bravo charlie delta echo foxtrot golf hotel --collect $200 endif end go Summary: instead of manipulating all the buttons, make their behavior match what you want them to do--that's the power of scripting! Paul Meyer pem@cadnetix.COM Cadnetix Corp. 5775 Central Ave. {uunet,boulder}!cadnetix!pem Boulder, CO 80301 (303)444-8075x244