[Lazarus] TTreenode.data

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Sep 11 15:09:16 CEST 2013


Antonio Fortuny schrieb:
> 
> Le 11/09/2013 07:51, Richard Mace a écrit :
>> Hi,
>> Can anyone give me an example of adding and retrieving an integer 
>> value to a TTreenode via it's data property please?
>>
>> I've tried the below, but it doesn't seem to work.
>>
>> Set:
>> with 
>> tvMain.Items.AddChildObject(tvMain.Selected,'string',TObject(fUserList.Items[I].Id)) 
>> do
> change to:
> with tvMain.Items.AddChildObject(tvMain.Selected,'string', 
> *Pointer*(fUserList.Items[I].Id)) do

I'd store fUserList.Items[I] there, which is an address and allows 
access to further values later.

DoDi





More information about the Lazarus mailing list