Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!news.miami.edu!umiami!dweisman From: dweisman@umiami.ir.miami.edu (Ordinary Man) Newsgroups: comp.sys.mac.programmer Subject: Re: ICONs as buttons in a dialog. Message-ID: <1991Feb16.002121.7836@umiami.ir.miami.edu> Date: 16 Feb 91 05:21:21 GMT References: <1CE00001.or5i24@tbomb.ice.com> Organization: Univ of Miami IR Lines: 39 In article <1CE00001.or5i24@tbomb.ice.com>, ** Sender Unknown ** writes: > > In article <1392@gertie.osc.edu>, spencer@cgrg.ohio-state.edu (Stephen N. Spencer) writes: >> I've created a dialog box which has the standard 'Cancel' and 'OK' buttons, >> and have five ICON resources that I'd like to use as buttons. I can display >> them in the dialog box, and I get dialog events when I click on them (it's a >> modeless dialog box...) but they don't invert or anything like that. >> >> Will I have to handle the inversion of the appropriate area of the screen >> (the clicked-upon ICON) myself or is there some other method for doing this? > > You need to use ICN# resources, with the icon mask data. > Example: [Example deleted] Another possible way seems a lot easier... Why not just do an InvertRect on the icon's rect. After all, inverting a rect works as a toggle. Wouldn't this be acceptable? As you said, you can evaluate which icon was clicked in; probably with PtInRect. Then just invert the rect that the point was in, and invert it again when the button is released, just like TrackControl does. I've never tried this but I imagine it would work fine, but maybe it would be slow, flickery, etc... ==Dan -- /-------------------------------------------------------------------------\ | Dan Weisman - University of Miami - Florida | || || || || | |--------------------------------------------------| || || ||\ /|| | | INTERNET -----> dweisman@umiami.IR.Miami.edu | || || || | || | | BITNET -----> dweisman@umiami | ||||||| || | || | |-------------------------------------------------------------------------| | "The more I get to see, the less I understand..." - Triumph | \_________________________________________________________________________/