Xref: utzoo comp.sys.mac.hypercard:4719 comp.sys.mac.programmer:18240 Path: utzoo!attcan!uunet!nih-csl!lhc!mimsy!haven!aplcen!uakari.primate.wisc.edu!sdd.hp.com!decwrl!shelby!morrow.stanford.edu!embezzle.stanford.edu!linde From: linde@embezzle.stanford.edu (Andrei Linde) Newsgroups: comp.sys.mac.hypercard,comp.sys.mac.programmer Subject: Re: odd-shaped buttons Message-ID: Date: 13 Oct 90 13:57:16 GMT References: <1990Oct13.000500.14994@midway.uchicago.edu> Sender: news@morrow.stanford.edu (UNIX News Service) Organization: Data Center, Stanford University, California, USA Lines: 40 francis@daisy.uchicago.edu (Francis Stracke) writes: >In article ch2i+@andrew.cmu.edu (Charles A. Hill) writes: >>I want to use the outlines of a picture to define the parameters of a >>button. In other words, if someone clicks anywhere within the outlines >>of a picture (no matter what shape the picture is), the button will be >>activated. I've been trying to improvise by filling all the nooks and >[...] >>I don't know any languages but Hypertalk, but I'm told that making an >>irregularly shaped picture "hot" is no sweat in a language such as C. >It's not incredibly easy. You'd have to have some way of getting the >region from the bitmap (is this supported by the Toolbox?), then check, >for each click, if the mouse is inside the region. >In HC, this would take a XFCN returning a handle to the region, and >another to check if a given point is in a given region. The card script >would catch the mouseUp event, then act on it as necessary. >Anybody in comp.sys.mac.programmer got any better ideas? >| Francis Stracke | My opinions are my own. I don't steal them.| >| Department of Mathematics |=============================================| >| University of Chicago | A mathematician is a professional | >| francis@zaphod.uchicago.edu | schizophrenic.--Me. | If picture is not too complex then just make several buttons on it which would countain script: on mouseUp click at loc of card button "MyPicture" end mouseUp and call one of the buttons on this picture "MyPicture" and give it a script that you want to be executed. Again if the picture is not too complex you will beable to aproximate it with rectangular buttons preety well. This is not the only choice, so if you don't like it try something else. - Dmitri Linde