Hi Stephen,

Thanks for your help, but my program still doesn't work. I have tried to
make a simple new project by just adding a button on the main form and add
the following code under capturing the CtrlSelectEvent:

case MainTestButton:
    #define GadgetID   3001
    FormPtr   NewPtr = frmP;
    FormGadgetType *GadgetType = FrmNewGadget ( (Form Type **) &NewPtr,
GadgetID, 50, 50, 20, 20);

but the program still crash everytime when I run the "FrmNewGadge( )"
function, do you know why?

Oscar


----- Original Message -----
From: "Stephan Veigl" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, February 12, 2001 7:04 AM
Subject: Re: Dynamic UI problem


> Hi Oscar
>
> > What should I set for the "id" in the following function?
> > FormGadgetType *FrmNewGadget (FormType **formPP, UInt16 id, Coord x,
Coord
> > y, Coord width, Coord height)
>
> the id is a unique object ID, just of the same type used in the PILRC
resource- / headerfiles (don't know how it's in CW, but there should also be
a 16 bit ID number for each object)
>
> > What should I set for the "id" and "rseID" in the following function?
> > FormBitmapType *FrmNewBitmap (FormType **formPP, UInt16 ID, UInt16
rscID,
> > Coord x, Coord y)
>
> rcsID is the (resource) ID of the bitmap you want to display. this is the
ID you used to define the BITMAP resource.
>
>
> > FormPtr   NewPtr = frmP;
> >
> > FormGadgetType *GadgetType = FrmNewGadget ((&NewPtr), 9999, 50, 50, 20,
20);
> >
> > FormBitmapType *A = FrmNewBitmap ((&NewPtr), 1234,  5678, 20 , 20);
>
> seams pretty ok, except that I would use ID defines and type casts (but
that's more a question of style)
>
>   #define GadgetID   3001  // unique ID nr
>
>   FormGadgetType *GadgetType = FrmNewGadget ( (Form Type **) &NewPtr,
GadgetID, 50, 50, 20, 20);
>
> for the bitmap: do you have a bitmap with the ID: 5678 in your resource
file?
>
> be sure to use only NewPtr after this function - even in parent functions,
the program may crash if you try to access the old frmP pointer
>
> by(e)
> Stephan
>
> --
> PGP Fingerprint: 0090 E02F 39A8 F2AF 6A79 43D7 B847 C26D 108E E2F0
> PGP PublicKey: http://www.unet.univie.ac.at/~a9526342/sveigl.asc
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


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