From: | Alfonso Ranieri |
Date: | 16 Jul 2001 at 04:50:02 |
Subject: | Re: (N)Listtree |
(I lost the original post by Robert)
(N)Listtree are betas rxmec. It means that many methods are to
be added and that they will change.
Sorry but I can't see any way to notify the Name of a opened node:
let's suppose you do a Open All method call. The Open hook is called
for any node opened. I can notify the Name of the opened node there,
but when the notification reaches the Application object, you get
only the id of the last opened node. E.g. if you do
call Notify("nlisttree","opened","everytime","app","return","say h.opened","triggerattr")
and 4 nodes are opened with a Open all method, you get 4 notifications
with always the last opened node. The good thing is that if a node is
opened clicking on it you get the right name. If it is resonable I will
leave the Opened attribute there.
-------------
Actually there is no way to get the tree entries and the tree
structure. I am working on it:
---
GetEntry - retrieves infos about a node
call DoMethod(obj,"GetEntry",<var>,<name>,[list],[flags])
Arguments:
var - an ARexx stem name
name - the node to get; a name or:
Active
list - a node name or:
Active
Root
flags - one or more of:
Activate
SameLevel
Visible
Result:
RC - a boolean to indicates if name was found
VAR - the contents of name
VAR.NAME - string, the name
VAR.ID - integer, the id
VAR.FROZEN - boolean, if the node is frozen
VAR.LIST - boolean, if the node is a list
VAR.NOSIGN - boolean, if the node is a list and it is not to have an arrows
VAR.OPEN - boolean, if the node is opened
VAR.SELECTED - boolean, if the node is selected
A new method called FindName:
---
FindName - finds a node starting at a position
call DoMethod(obj,"FindName",<var>,[tree],[pos],[flags])
Arguments:
var - an ARexx stem name
tree - the node to start at; a name or:
Active
Root
pos - the position relative to tree, one of:
Active
Head
Next
Parent
Previous
Tail
flags - one or more of:
SameLevel
Visible
Result:
RC - a boolean to indicates if the node was found:
VAR - the contents of name
VAR.NAME - string, the name
VAR.ID - integer, the id
VAR.FROZEN - boolean, if the node is frozen
VAR.LIST - boolean, if the node is a list
VAR.NOSIGN - boolean, if the node is a list and it is not to have an arrows
VAR.OPEN - boolean, if the node is opened
VAR.SELECTED - boolean, if the node is selected
Example:
...
call printList("root",0)
exit
printList: procedure
parse arg l,s
call DoMethod("list","FindName","e",l,"head")
do while rc
say copies(" ",s) || "Name:"e.name "Value:"e "ID:"e.id "IsList:"e.list
if e.list then call printList(e.name,s+1)
call DoMethod("list","FindName","e",e.name,"next")
end
return
Note: this is the only method that will let you get the
tree structure.
Don't know if a GetEntries method will be added. It should returns
all the entries in a plain list and it is not usefull.
Note that a (N)Listtree should not be used to store a lot of data.
It should be very small. E.g. let's consider ContactManager:
it has a little listtree at the left that just indexes a nlist
at the right. The main part of the information is in the nlist
not in the listtree. This is the use of (N)Listtree I have in mind.
Doing such a thing ala Amirc servers list in ARexx is not a good
idea at all.
Ciao. Alfonso.
ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/