Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!kth!draken!ttds!krona From: krona@ttds.UUCP (Kjell Krona) Newsgroups: comp.sys.mac.hypercard Subject: Re: Faster Button Summary: A more flexible way to program HyperCard Keywords: HyperTalk, object-orientation Message-ID: <1180@ttds.UUCP> Date: 2 Oct 88 16:34:24 GMT References: <70621@sun.uucp> <1482@pur-phy> Reply-To: krona@ttds.UUCP (Kjell Krona) Distribution: comp Organization: The Royal Inst. of Techn., Stockholm Lines: 48 One way to accomplish what you want is to use the function "the target", after giving the buttons in question the name of the function you want them to execute (for ex, "foo"). Then, in the stack script, place a a handler like on mousep if the short name of the target is "foo" then foo end if end mouseup on foo -- whatever you would like "foo" to do end foo OR PERHAPS on mouseup if the short name of the target is "foo" then put "foo" into bar do bar end if end mouseup ETC.. (the latter is useful if you would like to have more than one function, on different buttons) This can be extended and used with great effect. During the summer, I have implemented a small object-oriented system with proper inheritance in this way, complete with a simple Smalltalk- like editor/compiler. I this system, I also use arguments; the first word of the button/field specifies the function to execute, the second word specifies an argument for those functions that need it. So, differnt buttons may react similarly, but with differnt end results. Since "is all in the name" it is quite simple to change the way a button reacts. Whith the proper scripting done, a user not familiar with HyperTalk may still change the behavoiur of a button/field, choosing from the pre-programmed functions avaliable in this way. i have used this to make a small hypertext application, with the intention of extending it into a hypertext authoring environment. In the near future, I also intend to use it as a tool in my research on what kind of functions should be available i a user-oriented programmeing environment. - kjell