Hi Christian,
sorry for the delay - I was busy fighting with tablelist.
You don't know it, but it was precisely your suggestion to use
tablelist (a suggestion you made some 6 years ago here on clt) that
made me try my hands on tablelist - before turning to treeview.
I am in the mood of writing - so read on if you like.
This is my situation: I want to use a treeview of what ever brand to
display infos about the internals of a microprocessor: its
perpiherals, registers, etc.
But to be really useful tooltips are essential: While a tooltip cannot
possibly explain the complete function of a register or one of its
bitfields it might give someone enough of a hint to remember something
- without having to turn to the data sheets for every littlte detail
to look it up.
With this in mind I looked for 'treeview tooltip' and found
- on the wiki the posting by Keith Vetter mentioned earlier from which
I learned that I might have to implement tooltips myself, and
- via Google your recommendation mentioned above.
Since I have got the impression over the years that you are a very
knowledgable person (wrt Tcl), I considered this to be sound advice
(especially your mentioning of the 'tooltipaddcommand' was probably
decisive) and so I decided to turn to tablelist. Oh, had I only known
... :)
To acknowledge it up front: tablelist is a great widget with an
outstanding documentation. But for a first time user like me its
features are overwhelming. Add to this my missing knowledge of the
terminology used - to give you an example: I thought of 'opening' and
'closing' a node (like you open or close a file), but the terms used
by tablelist are 'expand' and 'collapse' - which are arguably the
better choice, but still: all this eats time.
But over time I made progress: I integrated my tooltips where I found
the '-formatcommand ' option especially useful: It allows you to put
several things for a cell together and when it is to be displayed the
command you passed to this option can take what it needs (e.g. via
[lindex ... 0]) and the tooltip can show its tip via [lindex ... 1] -
very nice.
During development I had been using the data of just one peripheral,
but when it came to use it on a whole processor I was in for a bad
surprise: You see, the processor I want to work (or rather 'hobby')
with is a really complex beast - probably the most complex I have ever
seen: its reference manual is a some 3400 pages long.
Well, to make it short: When tablelist had to work with the info of
the complete chip it became unbearingly slow - just an attempt to
resize it took ages. Sadly, not usable.
Therefore it was time to try out treeview which eventually lead me
here with my tooltip question. As it turned out tooltips aren't all
that difficult - but somehow the tablelist version looked much nicer.
It nagged me: Saving tablelist's content into a file was not a
problem, but when you re-loaded it all the "tree information" was
lost. But then I had an idea: How about 'on demand' expanding?
- load the saved data, but don't feed it into the tree yet,
- only insert (and by this: display) the top level nodes
- and on expanding any node insert its children into the tree.
- On collapsing reverse the operation.
This is what kept me busy the last few days. I think I am almost there
- but not quite yet. I will keep y'all informed. :)
Thanks for reading this far.
Helmut