tools/build_gtk_tree.js
[app.Builder.js] / tools / build_gtk_tree.js
index e404023..7b8c579 100644 (file)
@@ -297,7 +297,16 @@ right:
             tops[cls].pushUnique(par);
         }
     }
-    function canTop(cls) {
+    function canTop(cls, rec) {
+        
+        rec = rec || 0;
+        print('CANTOP: ' + cls + ' =' + rec);
+        if (rec > 5) {
+            print('SKIP : ' + cls);
+        }
+        if (typeof(tops[cls]) == 'undefined') {
+            return false;
+        }
         for (var i =0; i < tops[cls].length; i++) {
             if (tops[cls][i] == '*top') {
                 return true;
@@ -305,7 +314,7 @@ right:
             if (cls == tops[cls][i]) {
                 continue;
             }
-            if (canTop(cls)) {
+            if (canTop(tops[cls][i], rec+1)) {
                 return true;
             }
         }