Path: utzoo!attcan!uunet!mailrus!iuvax!rutgers!bellcore!flash!sdh From: sdh@flash.bellcore.com (Stephen D Hawley) Newsgroups: comp.sys.mac.programmer Subject: Re: Radio Buttons Message-ID: <21109@bellcore.bellcore.com> Date: 20 Mar 90 18:26:49 GMT References: <103386@linus.UUCP> Sender: news@bellcore.bellcore.com Reply-To: sdh@flash.UUCP (Stephen D Hawley) Organization: Bellcore, Morristown, NJ Lines: 37 In article <103386@linus.UUCP> cws@mbunix.mitre.org (Christopher C. Wilder-Smith) writes: >Hi, > >This is probably a real simple question... > >I have written code in the past for the Mac that uses radio buttons on >dialogs, no problem. Now I have a program where I want radio buttons on >the main window, and although they function correctly, the little dot in >the middle isn't automatically put in as in a dialog. Do I have to >generate the code for drawing the dot or have I overlooked something >obvious? > >Thanks in advance, > >Chris Yup, this is not too hard. What you want to do is something like this: myRadio = NewControl(ownerWindow, &boundsRect, "\PYour Title here.", TRUE /* visible */, 1 /* value 1 is set, 0 is clear */, 0 /* minimum */, 1 /* maximum */, radioButProc /* what type of control */, myReference /* refCon */); If the value is 1, it is set. If it is zero, it is clear. If you pull the control up from a resource file, use SetCtlValue() to change the default. eg, SetCtlValue(myRadio, 1); /* turn it on */ SetCtlValue(myRadio, 0); /* turn it off */ Steve Hawley sdh@flash.bellcore.com "I'm sick and tired of being told that ordinary decent people are fed up with being sick and tired. I know I'm certainly not, and I'm sick and tired of being told that I am."