Note: This e-mail contains recommendation for OS 4.0
>Steve Mann wrote:
>
>>You might be able to use something like this (I never tried it):
>>
>>oldFont = FntSetFont ( bldFont );
>>CtlSetLabel ( controlPointer, labelPointer );
>>FntSetFont ( oldFont );
>I'm virtually positive this doesn't work.
>
>This DOES work, although it accesses structures directly which some will
>say is a no-no:
>ctl=FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,i));
>ctl->font=boldFont;
>CtlEraseControl(ctl);
>CtlDrawControl(ctl);
>We use this in at least one of our apps to use buttons as column headers,
>allow the user to tap one or the other column header which is then used
>as the Sort field, and that header then becomes bold (and the others
>plain).
>Steve Patt
>President, Stevens Creek Software
Yes I agree! The new rules introduced with OS 4.0 (eventually
targetting OS 5.0) about not directly modifying structure elements
will only work if OS functions are provided where this technique is used.
We routinely "fix up" fields before displaying the screen depending on
various settings. Most of the fixing up, such as moving fields around,
modifying labels, presetting field, check box etc values, hiding and
showing buttons, fields and other controls can all be done successfully
before calling FrmDrawForm().
One big issue is changing the font of a field or other control.
FldSetFont() attempts to draw to the screen so you can't use it before
FrmDrawForm(). The only current way of changing a font is to
modify the font element of the structure. But this technique is now
illegal.
Can Palm Inc PLEASE provide a CtlSetFont() function to change
the font of a control without drawing to the screen, and without the
programmer writing directly to the structure. Or make the function
smart enough (as some are) to only write to the screen if it is
permitted to.
Roger Stringer
Marietta Systems, Inc.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/