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/