David,
Are you saying that Palm OS Emulator 3.1 is displaying a warning when
you access the "attr" field? If so, then I don't think it should be.
Poser will display the warning only if no alternative exists for
accessing the "attr" field. An alternative *does* exist, but only
for 68K applications running on ARM devices. Is that what you're
testing under? :-)
If you have the 4.0 SDK, you should be calling
FrmGlueGetObjectUsable, which recognizes the conditions under which a
valid accessor function exists and calls it if it does. Otherwise,
it will perform the direct access for you.
-- Keith Rollin
-- Palm OS Emulator engineer
At 6:28 PM -0400 3/29/01, David Kendall wrote:
>I have some code that manages my scrollers, thusly:
>
> FrmUpdateScrollers(pForm, iScrollUp, iScrollDn, enableUp , enableDown );
>
>I've been gleefully, willfully, and with much recklessness, looking at the
>control structure to decide whether a scroller is active...
>
> ControlPtr pctl = (ControlPtr) FrmGetObjectPtr(pForm, index);
> if(pctl->attr.usable && pctl->attr.enabled)
> // do it...
>
>The reason I check "usable" is that if enableUp and enableDown are both
>false, the control is set to usable=0, and "enabled" is not cleared.
>
>Soooo... calling CtlEnabled() is not sufficient.
>
>If enableUp and enableDown are both false, I can call CtlSetEnabled(false)
>for each of the scroller controls, but that kinda defeats the purpose of
>FrmUpdateScrollers. I can also stuff these variables away in yet-more
>globals... But it seems like I'm having to do a lot of workaround to remove
>structure access!
>
>David
--
-- Keith Rollin
-- Palm OS Emulator engineer
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/