No luck!
I did this with pText a global. It appears that the pointer for the label is not
available. I first set the label to "Original" at
design time. This shows up as expected at run time. I push on the button and I get
my list. I select from the list and now the
Popup trigger has the new label. This stays.
if Control <> nil then
begin
FrmCustomAlert(AlertError, 'Got Control ptr', '', '');
//Nothing happens to the control!!
pText := 'Testing';
FrmCustomAlert(AlertError, pText, '', '');
CtlSetLabel(Control, pText);
end else
FrmCustomAlert(AlertError, 'Control ptr = nil', '', '');
Todd
--
Todd Cary
Ariste Software
[EMAIL PROTECTED]
Richard Burmeister wrote:
> > From: Todd Cary
> >
> > With the code below, nothing happens. What am I missing?
> >
> > begin
> > ...
> > PopupIndex := FrmGetObjectIndex(Form, PopuptriggerVariety);
> > Control := ControlPtr(FrmGetObjectPtr(Form, PopupIndex));
> > if Control <> nil then
> > begin
> > FrmCustomAlert(AlertError, 'Got Control ptr', '', '');
> > //Nothing happens to the control!!
> > CtlSetLabel(Control, 'Test');
> > end else
> > FrmCustomAlert(AlertError, 'Control ptr = nil', '', '');
> > ...
> > end;
> >
>
> Try using a global pChar for the label. CtlSetLabel does *not* make a copy
> of the label, so you have to make sure the label exists as long as the
> control is being displayed. I don't remember where Delphi stores hardcoded
> strings, but its possible that it goes out of scope as soon as the function
> ends, and that would make it appear like CtlSetLabel() did nothing.
>
> --
> 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/