Page 1 of 1

ListTree - attempt to get previous node

Posted: Fri Mar 30, 2018 12:27 am
by djrikki
Okay I attempting to return the previous node of the (last) VGroup item - which in this situation is the middle named Register node.

However, clearly I am not doing something right (or Royale is broken) because when I call 'previous' on the 'active' node I get a DSI everytime. Which of course shouldn't happen anyway, so two issues here how do I accomplish what I trying to do; and secondly MUI Royale should never DSI just because I am maybe trying to do something illegal.

Code: Select all

Local found, previous = mui.DoMethod( "windowtree-" .. PadNum(Windows:ReturnActiveWindow(),3), "getentry", "active", "previous", "" )
If found = True
    debugprint(previous.name)
EndIf        
Image

Re: ListTree - attempt to get previous node

Posted: Fri Mar 30, 2018 12:42 am
by djrikki
Local found, active = mui.DoMethod( "windowtree-" .. PadNum(Windows:ReturnActiveWindow(),3), "getentry", "active", "head", "" )
found, parent = mui.DoMethod( "windowtree-" .. PadNum(Windows:ReturnActiveWindow(),3), "getentry", active.muiid, "parent", "" )

In the end I did this which seems a bit long-winded! ^.^

Re: ListTree - attempt to get previous node

Posted: Fri Mar 30, 2018 10:58 am
by SamuraiCrow

Code: Select all

Local winname$="windowtree-" .. PadNum(Windows:ReturnActiveWindow(),3)
Local found, active = mui.DoMethod( winname$, "getentry", "active", "head", "" )
found, parent  = mui.DoMethod( winname$, "getentry", active.muiid, "parent", "" )
is shorter and faster... ;)

Re: ListTree - attempt to get previous node

Posted: Fri Mar 30, 2018 5:48 pm
by djrikki
Thanks, I have plenty of optimising to do.