ListTree - attempt to get previous node

Discuss GUI programming with the MUI Royale plugin here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

ListTree - attempt to get previous node

Post by djrikki » Fri Mar 30, 2018 12:27 am

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
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: ListTree - attempt to get previous node

Post by djrikki » Fri Mar 30, 2018 12:42 am

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! ^.^
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

SamuraiCrow
Posts: 159
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

Re: ListTree - attempt to get previous node

Post by SamuraiCrow » Fri Mar 30, 2018 10:58 am

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... ;)

djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: ListTree - attempt to get previous node

Post by djrikki » Fri Mar 30, 2018 5:48 pm

Thanks, I have plenty of optimising to do.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

Post Reply