<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks Antonio, that worked fine.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Goodness knows what I was originally doing!</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Richard</div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">
<br>
</div>
</div>
</blockquote></div>
Details are missing about your implementation: Lzarus & FPC, OS,
etc. I've made a little test on Win32 and Linux_X64, Lazarus 1.0.12<br>
I added some nodes to the TTreeView like this:<br>
<br>
var<br>
SData: Integer=179;<br>
<br>
procedure TFrmMain.BtnTestTvClick(Sender: TObject);<br>
var<br>
wNode: TTreeNode = nil;<br>
s: String;<br>
begin<br>
Inc(SData);<br>
wNode := Ttv.Items.AddChildObject(nil, 'node new',
Pointer(SData));<br>
s := Format('node %s data:%d', [wNode.Text, PtrInt(wNode.Data)]);<br>
MessageDlg('Titre', s, mtInformation, [mbOK], 0, mbOK);<br>
end;<br>
<br>
The I added an event to Ttv.OnChange event like that:<br>
procedure TFrmMain.TtvChange(Sender: TObject; Node: TTreeNode);<br>
var<br>
wData: Integer;<br>
begin<br>
if Assigned(Node) then begin<br>
wData := PtrInt(Node.Data);<br>
MessageDlg('Titre',Format('data for "%s" %d', [Node.Text,
wData]), mtInformation, [mbOK], 0, mbOK);<br>
end;<br>
end;<br>
<br>
I get a new node on every BtnTestTvClick and a value starting from
180 on every OnChange event<br>
On both platforms.<span class="HOEnZb"><font color="#888888"><br>
<br>
Antonio.<br></font></span></div></blockquote></div></div></div>