<p dir="ltr">Thanks for the reply. <br>
Can't it be type casted because both a pointer and integer are 4 bytes? </p>
<div class="gmail_quote">On 11 Sep 2013 10:46, "Graeme Geldenhuys" <<a href="mailto:graeme@geldenhuys.co.uk">graeme@geldenhuys.co.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2013-09-11 06:51, Richard Mace wrote:<br>
> Can anyone give me an example of adding and retrieving an integer value to<br>
> a TTreenode via it's data property please?<br>
<br>
The Data property holds a pointer value, so don't assign an Integer<br>
directly. Rather define a Record structure (or a Class) that holds the<br>
data you want (in your case an Integer field), then assign the pointer<br>
to the record structure to the Treenode.Data property.<br>
<br>
There is an example in the LCL documentation:<br>
<br>
<a href="http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html" target="_blank">http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreenode.data.html</a><br>
<br>
<br>
Regards,<br>
Graeme<br>
<br>
--<br>
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal<br>
<a href="http://fpgui.sourceforge.net/" target="_blank">http://fpgui.sourceforge.net/</a><br>
<br>
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</blockquote></div>