tests/enum.vala
[app.Builder.js] / tests / enum.vala
index 420a1f8..d1b2759 100644 (file)
@@ -4,10 +4,17 @@
 
 
 int main (string[] args) {
-       
-       stdout.printf ("%s\n", Type.from_name ("Gtk.Orientation.VERTICAL").name ());
-       
+       Gtk.init(ref args);
+       var type = typeof(Gtk.Box);
+       var  ocl = (ObjectClass) type.class_ref ();
+       var ps = ocl.find_property("orientation");
+       var vt = ps.value_type;
+    EnumClass ec = (EnumClass) vt.class_ref ();
+       for (var i =0;i< ec.n_values; i++) {
+               var ev = ec.values[i];
+               print("%s : %d", ev.value_name,ev.value);
+       }
+        
        return 0;
 }