On Mon, Apr 08, 2002 at 08:16:38AM -0700, John Leung wrote:
> On 8 Apr 2002 at 10:59, Thomas Ward wrote:
>> I have an app that requires Palm OS 2.0 or later. On one of its forms is a
>> table that needs to be shown or hidden based on certain criteria. Since
>> FrmHideObject does work correctly on tables until 4.0, I could not use it.
>
> Have you tried explicitly checking the OS version in your set_table_usable
> function? That is if you have the OS that has fixed the problem, then do
> nothing, otherwise, set the attribute. I don't know how long this
> technique will last because if people start to change the table's data
> structure in any future OS, then you're screwed. I personally don't know
> if you'll ever see a FrmGlueHideObject. This problem has been around for
> a LONG time and I'm guessing that no one really seems to care to make a
> glue function for it.
Surely what you just described *is* a glue function for it? Why wait
for someone else to provide it when you can do it yourself? :-)
#define ALLOW_ACCESS_TO_INTERNALS_OF_TABLES
void MyFrmGlueHideObject (FormType *form, UInt16 ndx) {
FrmHideObject (form, ndx);
if (/* sysFtrNumROMVersion < 4.0 */ && /* it's a table */)
/*the_table*/->attr.usable = false;
}
This technique will last just fine, because it *doesn't* attempt to
"change the table's data structure in any future OS". It only does the
Bad Thing on the old crappy OS, not the future ones.
If a glue function for this were added to PalmOSGlue, that's exactly
what it would look like (modulo other bugs in addition to tables that it
needed to take care of).
There are only two things that are special about a "glue function"
provided by PalmSource:
* tools like Poser know its name, so can avoid producing diagnostics
when it does Bad Things. In this case, I don't think any additional
avoidance is necessary anyway, because I think Poser allows apps to
write to this table attribute on the old crappy OSes;
* everyone has it.
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/