|
From: Andreas K. <aku...@sh...> - 2004-09-24 04:15:34
|
> Joe English wrote:
>
>
> > I hadn't considered this, but am open to suggestions.
> > The Tk way of doing this would be a linked -variable;
> > but for the tree widget the contents of the variable
> > would have to be a fairly complicated structure.
>
> Couldn't it just be an array (or dict)?
>
> array set data {
Remember Brian Griffin's mail as well, he had some ideas regarding
this too. Even based on actual experience.
I quote ...
> ... would also like to see an incremental or dynamic interface that
> allows for support of larger datasets. We have an interface on our
> tree that is comprised of three configure options: -querycommand,
> -querysizecmd, -queryblocksize. The -querycommand is called
> whenever a node is expanded (opened), and is passed the node id (""
> for root). The command will return a list of items which are the
> children for that node. Each element of the list is a list of
> triples, one triple for each column. The triple is comprised of
> {<label> <tags> <image>}. The label and image should be obvious.
> The tags element is a list of flags, the primary ones being
> "branch", or "leaf".
> In the simple case, all the children for a node are returned when
> requested. To handle large datasets, the -querysizecmd and
> -queryblocksize are used. Before calling -querycommand, the
> -querysizecmd is called to calculate the number of children for the
> node. Then the -querycommand is called with two additional
> parameters, a start index and a count (count comes from
> -queryblocksize). The callback will only return "count" items
> starting at the start index. The widget determines what range is
> needed based on the scroll offset and only makes enough calls to get
> the data needed to satisfy the display. Also, the command callbacks
> support % substitution for node (%n), start (%s), and count (%c).
> I find this interface easier to use then the traditional "$w insert
> ..." interface, especially when the data is dynamic. A simple
> trigger can be used to cause the widget to re-acquire the data from
> the callbacks.
--
So long,
Andreas Kupries <aku...@sh...>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
|