Yes! You got the bug.
How careless I was, I used the resource ID instead the object index
to pass into the FrmHideObject()/FrmShowObject() so it doesn't work.

It's really easy to passed the wrong object parameters to the APIs since
there are object pointer, object index, and object ID used in the APIs.

Thank you for your help.

Coolly

"Anton Nikolaev" <[EMAIL PROTECTED]> ?????
news:61468@palm-dev-forum...
>
> Oh no, it will not work actually. FrmGetLabel accepts labelID and
> FrmHideObject accepts object INDEX. This means that you should use:
> FrmHideObject(frmP,FrmGetObjectIndex(frmP,AmountLabel));   //  if Amount
> label is object id
>  // or
> FrmHideObject(frmP,Label);  // if Label is object Index
> The same is for FrmShowObject;
> Anton
> ----- Original Message -----
> From: "Coolly Lee" <[EMAIL PROTECTED]>
> Newsgroups: palm-dev-forum
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Saturday, September 01, 2001 2:29 PM
> Subject: FrmHideObject and FrmShowObject Problems
>
>
> > Dear Gurus,
> >
> >   I got problems in using FrmHideObject() and FrmShowObject()
> > to erase/show the labels.
> >
> >   In my program, I use labels to show dynamic data. When data changed,
> > the program calls FrmCopyLabel() to refresh the data to be shown.
> > According to the Palm OS Reference, the FrmCopyLabel() redraws the new
> > label without erasing the old one so that the end of the longer old
label
> > still
> > shown on the form. To avoid this, the program should call
FrmHideObject()
> > and FrmShowObject() before and after calling FrmCopyLabel()
respectively.
> > But it doesn't work in my program. Did I miss something?
> >
> >   The code is like this:
> > /*--------------------------------*/
> > UInt32 amount;
> > Char *label;
> > ......
> > label = (Char *) FrmGetLabel(frmP, AmountLabel);
> > MakeAmountString(amount, label);    // covert the data into string
> >
> > FrmHideObject(frmP, AmountLabel);
> > FrmCopyLabel(frmP, Label, label);
> > FrmShowObject(frmP, AmountLabel);
> >
> > Any comment?
> > Coolly
> >
> >
> >
> > --
> > 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