home *** CD-ROM | disk | FTP | other *** search
Wrap
Path: sparky!uunet!psinntp!iat.holonet.net!bmug!Philip_J._Grandinetti Message-ID: <1993Jan24.153842.213406@bmug.org> Newsgroups: comp.sys.mac.programmer Distribution: world From: Philip_J._Grandinetti@bmug.org Organization: BMUG, Inc. Date: Sun, 24 Jan 1993 15:38:42 PST Subject: Re: Geneva 9 Radio Buttons, Checkboxes, etc... Lines: 43 It's fairly straightforward to get your radio buttons and checkboxes in geneva 9. First step: Use ResEdit to create a new control resource and set the ProcID to either 9 or 10 for checkbox or radio button respectively. Define all the other parameters (e.g. name, sizes, etc). Then use Resedit DITL editor to add the new control to your dialog (don't forget to specify the Resource ID). Second step: In your source code change the font for your dialog box to geneva. I do this when I set up my dialogs, and use a routine I got from the book "Extending the Macintosh Toolbox" by May and Whittle called SetDFont() that I modified slightly to fix a bug in it. For example, myDialog = GetNewDialog(myDialogID, 0L, (WindowPtr) -1L); SetDFont(myDialog,geneva,fontSize,fontStyle,copyMode); I probably shouldn't reproduce it here for legal reasons, but my bug fix is to include the lines FontInfo finfo; TextFont(fontNumber); TextFace(fontStyle); TextMode(copyMode); TextSize(fontSize); GetFontInfo(&finfo); (*((DialogPeek)theDialog)->textH)->fontAscent = finfo.ascent; (*((DialogPeek)theDialog)->textH)->lineHeight = finfo.ascent + finfo.descent + finfo.leading; and to move the variable fontName to the subroutine arguments, replacing fontName. I recommend the book as a good source for things like this, but I have had quite a few problems implementing some of the routines because of minor bugs. Good Luck, Philip **** From Planet BMUG, the FirstClass BBS of BMUG. The message contained in **** this posting does not in any way reflect BMUG's official views.