Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-01

Treeview example(s) needed

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Santhoff
to Joe Shepherd
Joe Shepherd wrote
Obvioiusly I'm missing a lot but I cannot find any example to dispel the fog. Anyone got one?

Not really. Some information can be found there:

http://wiki.lazarus.freepascal.org/XML_Tutorial#Populating_a_TreeView_with_XML

But I cannot say if that helps you. The main page in the wiki is this one:

http://wiki.lazarus.freepascal.org/VirtualTreeview

and it shows the way to get a help file:

http://wiki.lazarus.freepascal.org/VirtualTreeview#Help

Have fun,
Marc

Marc Santhoff

Reply by email

Vincent Snijders
to Joe Shepherd: An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/laz…

2016-01-27 6:01 GMT+01:00 Joe Shepherd :

Show quoted text 7 lines
Hi I'm having trouble with TTreeView - no doubt due to ignorance. Does anyone have simple example(s) of builing and using a treeview?

The lazarus source contains a treeview example:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/examples/treeview/?root=lazarus

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160127/154bced2/attachment-0001.html>

Reply by email

Mattias Gaertner
to Marc Santhoff: Not really. Some information can be found there:…
Show quoted text 13 lines
On Mi, 2016-01-27 at 06:01 +0100, Joe Shepherd wrote: > > Obvioiusly I'm missing a lot but I cannot find any example to dispel > the fog. Anyone got one? Not really. Some information can be found there: http://wiki.lazarus.freepascal.org/XML_Tutorial#Populating_a_TreeView_with_XML But I cannot say if that helps you. The main page in the wiki is this one: http://wiki.lazarus.freepascal.org/VirtualTreeview

VirtualTreeView TTreeView

Mattias

Reply by email

Mattias Gaertner
to Joe Shepherd: An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/laz…
Show quoted text 8 lines
[...] newnode := tv.items.addchild(nil, 'A'); newnode := tv.items.addchild(nil, 'B'); newnode := tv.items.addchild(newnode, 'B1'); newnode := tv.items.addchild(newnode, 'B12'); newnode := tv.items.addchild(newnode, 'B123'); [...] If the treeview option tvoAutoExpand is True, I get the whole tree and can click about the tree and select nodes. But if tvoAutoExpand is False, the tree is (correctly) drawn collapsed, and clicking to expand (eg node B), or on a node with no children (eg Node A) both result in a SigSegV in include/treeview.inc at line 1590 which is the indicated line here:

Clicking on nodes should not create AV, unless you have some more code than just the above 5 lines.
The method GetLevel is not called by the LCL, so I guess you use it somewhere.
Use the debugger to create a backtrace of the AV to find out what causes the AV.

Mattias

Reply by email

Mattias Gaertner
to Joe Shepherd
Thanks, but that's hardly the way (with standalone buttons) anyone would use a treeview.

It demonstrates adding, deleting and selecting nodes.

Surely the TV's own events (onClick, onChange...) are preferable?

Do you mean you search general examples/documentation for the TV's events like? Or do you need some help with specific events?

Apart from some terse words about lack of information on StackExchange, I see nothing on-line about them

Several examples use TTreeView. Use 'Find in Files' to search for 'TTreeView' in the 'lazarus/examples' directory.
For instance xmlreader/testxmlreder.lpi

Mattias

Reply by email