[comp.sys.mac.programmer] setting font for individual edittext items in modeless dialogs

rotberg@dms.UUCP (Ed Rotberg) (11/28/89)

From vn Mon Nov 27 16:35:34 1989
From article <21431@ut-emx.UUCP>, by rdd@walt.cc.utexas.edu (Robert Dorsett):
> I guess the title says it all...:-)  Anyone have any demo code?  I have 
> several edittext items in a modeless dialog.  I want one of them to be in 
> monaco 9, the rest in Chicago 12.  I've tried getditem and changing (what
> I believe) to be the appropriate edittext fields, but nothing happens...
> 

There is a mechanism in the newer version of the systems (4.2 or later, I
think) that allows you to set the font of individual edittext items in
a modal (or modeless) dialog.  This is using the 'dctb' mechanism that is
described in IM volume V.  It also lets you set color for individual items,
text or otherwise.  However, if you are planning on changing the size of the
font, while this is also supported, there are some problems with this.  I
tried to use this mechanism myself of a dialog box that needed a custom font
for some custom characters.  I was eventually able to get the Dialog manager
to use the right font, however, I needed it in 18 point, and try as I might
even thought the Dialog manager gave me the right size, the line height,
assent and descent info was all wrong (apparently the stuff for Chicage 12 pt).
I sent the code to Macintosh Developer Support and they agreed that the
Dialog Manager was blowing it.  Now this was prior to the 6.0 system release,
and may have been fixed by now.  My solution at the time was to write my own
"dialog manager" for that one box, and just open a window with the proper
defproc, text fields, and controls, and do all the modal stuff myself.

I hope this helps.

	- Ed Rotberg -