Trees in Scilab > 5.1.1

Samuel Gougeon Samuel.Gougeon at univ-lemans.fr
Tue Nov 3 21:21:03 CET 2009


Hi,

Trees of activable items (with callbacks) are a new and very nice
item available for Scilab > 5.1.1.
4 functions are useful for building, displaying and printing trees:
createNode(), createTree(), dumpTree(), and displaytree().

After trying these functions, some remarks might be done,
as well as some questions remain.
IMO, there are too numerous to be posted as individual
bug+resquest reports, and since posting several questions
in a single report is not correct, a post for discussion in the
newsgroup is preferred (at least as a first step).

* About *functions names* :
IMO, capitalising the N in createNode() etc is a very good idea,
to make functions names more readable.
Unfortunately, this is very exceptional in Scilab (so we have
for instance /getinstalledlookandfeels()/, that looks not so pleasant
than if it would have been /getInstalledLookAndFeels()/ ).
So, we should expect /displayTree()/ instead of /displaytree()/.
Or, as a worse but more regular naming, createnode() instead of
createNode(), etc.

* About *help pages *:
for createTree() : The last line of the example should be
treeRoot = createTree( root, treeNode1, node2, treeNode3)
instead of
treeRoot = createTree( root, node1, node2, node3)
Same thing in the example given for displaytree().
(Bug just posted)



* About *CreateTree()* : This is the "branching function".
It would be usefull to add a second argument (scalar boolean)
for specifying whether the branched node should by default
be developped (so displaying the downstream tree) or not.

* About *displaytree() *:
returns an undocumented value, that looks simply the tree's
handle passed in argument. Unfortunately,
  - no handle is returned for the window displaying the tree.
  - winlist() does not list the new window
  - it is possible neither to modify (naming, sizing, locating,
    foreground & background-colorizing etc) nor to delete the
    window with a script (or even by hand (except resizing and
    positionning))

* a new *foldTree(*tree [, unfolded [, maxDepth] ) function could be
   usefull, to post-fold or post-develop a (sub)tree after displaying it.
   The first argument could be either a single tree handle, or a list
   of handles. /unfolded/ could be either a boolean (for assigning status),
   or -1 (to switch trees' status)

Since Scilab 5.2 has not yet been released, these rems & ideas cannot
make an official Scilab Enhancement Proposal :-)
(moreover, SEP have to be posted on the dev-list, while all users may
discuss this here).

Expecting your comments,
Regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20091103/5decfffe/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: moz-screenshot-4.jpg
Type: image/jpeg
Size: 6781 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20091103/5decfffe/attachment.jpg>


More information about the users mailing list