tools/build_gtk_tree.js
[app.Builder.js] / tools / build_gtk_tree.js
index 1f09304..8f0f940 100644 (file)
@@ -276,10 +276,11 @@ function BuildLists () {
         if (method !='Gtk.Container:add') {
             return true;
         }
-        
-        var cls = parent.split('.').pop();
+        var ar =  parent.split('.')
+        var cls =ar[1];
+        var ns =ar[0];
          
-        
+        /*
         if (parent == 'Gtk.Bin' || methods['Gtk.Bin'].extendsClasses.indexOf(parent) > -1) {
             return false;
         }
@@ -291,13 +292,23 @@ function BuildLists () {
              ].indexOf(parent) > -1) {
              return false;
         }
+        */
+        
+        
+        try {
+            var x = new imports.gi[ns][cls]();
+        } catch(e) {
+            print("TRY ctor:  " + parent );
+            print(e.toString());
+            return false;
+        }
         
-        //print("TRY ctor:  " + parent );
-
-        var x = new imports.gi.Gtk[cls]();
         //print("TRY child type:  " + parent);
         
-        //print(parent + " : says children are of type : " + x.child_type());
+        print(parent + " : says children are of type : " + x.child_type());
+        // get the Gtype for the child?
+        
+        
         return true;
         
     }
@@ -360,9 +371,11 @@ right:
             continue;
         }
         for (var par in methods[cls].can_be_added_to_as) {
-             if (!verifyUsage(par,cls)) {
+            
+            if (!verifyUsage(par,cls)) {
                 continue;
             }
+            
             if (typeof(usage[par]) == 'undefined') {
                 usage[par] = [];
             }