> Yes. As far as the OS is concerned, it's (the gadget's data) nothing more
than 4 
> consecutive bytes in the gadget's internal data structure.

Aha! Well, that being the case, I don't need to mess with storing a pointer,
I'll just store the data itself - it's just a Boolean:

FrmSetGadgetData(pForm, nGadgetIndex, &boolValue);

Then, when I want to get the value, since FrmGetGadgetData( ) returns a
pointer, I still have to do this:

Boolean *pBoolVal = FrmGetGadgetData(pForm, nGadgetIndex);

if (*pBoolVal == true) {
  //do something
}

Is that enough? Or do I have to first use MemPtrNew( ) to allocate memory
for pBooVal, and when I'm done, use MemPtrFree to free it up? Like so:

Boolean *pBoolVal = MemPtrNew(sizeof(Boolean));
pBoolVal = FrmGetGadgetData(pForm, nGadgetIndex);

if (*pBoolVal == true) {
  // do something
}

MemPtrFree(pBoolVal);

Sorry to beat this to death, but this is a good example of the kinds of
thing I spend SO much time on, and I don't feel like I'm really *getting it*
- just muddling my way through. Thanks so much for all help given so far,
and for this, too.

Brian Smith

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to