Page 1 of 2

DSI

Posted: Thu Dec 04, 2014 11:43 am
by djrikki
Whilst developing a new app I constantly see this from The Grim Reaper, I also experienced this from time to time with Jack.

http://www.lakemarketing.co.uk/jack/Jac ... ture19.png

Before you ask for a code snippet, do you know what could possible to causing this? PS. All MUI buttons are strictly AISS icons, nothing else. I have an 'feeling' its something to do with toolbarbutton. At the moment when I press a toolbarbutton in my app (even when the associated function it goes to is empty) - releasing the toolbarbutton will instantly cause a DSI - very frustrating.

Re: DSI

Posted: Thu Dec 04, 2014 1:28 pm
by airsoftsoftwair
No, you need to provide a code snippet that reproduces it. Then I can check what's wrong there...

Re: DSI

Posted: Fri Dec 12, 2014 8:55 pm
by airsoftsoftwair
Check your email for a WIP build of MUI Royale 1.3. Maybe the problem is already fixed...

Re: DSI

Posted: Sat Dec 13, 2014 3:25 pm
by djrikki
I think some of this crash is related to incorrect usage of the method Insert into a ListTree.

Image

See how Button 1 is at the bottom of the listree and its lost its inheritance - I want it to be inserted directly after the Active node - in this case between it and the Clicktab node.

The active node in the above screen captured has the ID of 'vgroup-0'. If I use the below code and paste in a debug message shown below I get the above result shown in the capture.

Code: Select all

Function Layout:AddButton()  
    Local object
    object = {}
    object.class = "Button"
    object.icon = #TOOLBARBUTTON
    object.id = "vgroup0-button1"
    object.name = object.class
    object.hichar = ""
    object.toggle = False
    object.help = ""
    object.ckey = ""
    object.disabled = False
    object.hidden = False
    debugprint("object.id = " .. object.id)
       
    debugprint("layout","insert","\27A[" .. object.icon .."] " .. object.name .. " 1 \27u\27P[888888](" .. object.class .. ")",object.id ,"vgroup-0","active","active;open")

    mui.DoMethod("layout","insert","\27A[" .. object.icon .."] " .. object.name .. " 1 \27u\27P[888888](" .. object.class .. ")",object.id ,"vgroup-0","active","active;open")
    mui.Set(object.id,"userdata","fred")
    
    debugprint( "addbutton userdata = " .. mui.Get(object.id,"userdata") )
       
EndFunction
Result:
layout insert [54] Button 1 [888888](Button) vgroup0-button1 vgroup-0 active active;open

This causes a DSI messages straightaway.

After a while my system seems to get fragile, missing icons from [buttons] etc... I assume memory is getting corrupt or something over time.

PS: See the userdata being set to the string 'fred' followed by the DebugPrint command straight afterwards - it prints an Empty string.

Re: DSI

Posted: Sat Dec 13, 2014 10:39 pm
by bitRocky
The wrong position of the new node is because you used the special value "active" as the previous node.
I had the same problem and found the solution, you have to get a real treenode ptr for the prevnode!

Re: DSI

Posted: Sun Dec 14, 2014 6:47 pm
by djrikki
Please expand or show example, thank you.

Re: DSI

Posted: Mon Dec 15, 2014 6:08 pm
by airsoftsoftwair
Please post a complete example (Hollywood and XML code) that I can run here. Then I'm likely able to tell what's wrong there...

Re: DSI

Posted: Mon Dec 15, 2014 9:43 pm
by djrikki
Snapshot of ListTree XML declaration:

Code: Select all

								<listtree id="layout" notify="active;doubleclick" cyclechain="1">
									<node id="vgroup-0" name="\33P[FF0000] Default Application Window (VGROUP) \33A[100] " open="true">
										<node id="clicktab-0" name="\33P[0000FF]\33A[60] (CLICKTAB)" open="true">
											<node id="vgroup-1" name="\33P[FF0000]\33A[14] File Tab (VGROUP) \33A[100] " open="true">
												<item id="listbrowser-0">\33A[76] ListBrowser \33u\33P[888888](ListBrowser)</item>
												<node id="hgroup-0" name="\33P[FF0000](HGROUP) \33A[72] " open="true">
													<item id="colour-0">\33A[70] Select a colour (Label)</item>
													<item id="colour-1">\33A[62] coloradjust \33u\33P[888888](coloradjust)</item>
												</node>
											</node>
											<node id="vgroup-2" name="\33P[FF0000]\33A[14] Other Tab (VGROUP)\33A[100]" open="true">
												<item id="othertab-0">\33A[76] Printers \33u\33P[888888](Radio)</item>
												<item id="othertab-1">\33A[98] ListTree \33u\33P[888888](ListTree)</item>
												<item id="othertab-2">\33A[96] \33u\33P[888888](Hollywood Display)</item>
											</node>	
										</node>	
                                                                     </node>
                                                             </listtree>

Re: DSI

Posted: Mon Dec 15, 2014 9:49 pm
by djrikki
On the prevnode if I specify..

Code: Select all

mui.Get("layout","active")
Instead of just "active"...

I still get a DSI but the branch is visually shown joining to the selected node.

Re: DSI

Posted: Mon Dec 15, 2014 11:34 pm
by airsoftsoftwair
I'm afraid but snapshots don't help... I need a complete example (as short as possible!) that I can copy and paste into a Hollywood script and XML file to examine what's wrong there.