Fix 'uicontextmenu' handles display after https://codereview.scilab.org/#/c/11942/ 99/13199/2
Vincent COUVERT [Fri, 22 Nov 2013 13:31:50 +0000 (14:31 +0100)]
To test:
test_run gui bug_4782
test_run gui bug_4782_v5

Change-Id: I9b91a04119d86a6819f35cc5a02dd2416846839f

scilab/modules/graphics/macros/%h_p.sci

index aff1db1..e8aec72 100755 (executable)
@@ -939,8 +939,13 @@ function %h_p(h)
             // =====================================================================
 
         case "uicontextmenu"
+            if isempty(h.parent) then // For an uicontextmenu, parent can be empty
+                parent = "";
+            else
+                parent = h.parent.type;
+            end
             t=[t;
-            "Parent: "+h.parent.type
+            "Parent: "+parent
             "Children: "+fmtchildren(h.children)
             ]