I'm playing around with gadgets and I have a question about the data that
can be stored with them.

Lets say I want to associate an integer with a gadget and I do something
like the following:

        VoidHand        vh;
        FormPtr frm = FrmGetActiveForm();

        vh = MemHandleNew (sizeof(UInt16));
        if (vh)
        {
                * (UInt16 *) MemHandleLock (vh) = 1;
                MemHandleUnlock (vh);
                FrmSetGadgetData (frm, FrmGetObjectIndex (frm, MyGadgetID), vh);
        }

What happens to the old data that was associated with the gadget (assuming I
had called the above at least once before)?

And... (somewhat of a C related question I think), if I have a second gadget
named MyGadgetID2, is it legal to follow the above code with this:

        FrmSetGadgetData (frm, FrmGetObjectIndex (frm, MyGadgetID2), vh);

Mitch Fawcett
Tapn'see Software
http://www.tapnsee.com
Home of SuperList2


-- 
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