tests/enum.vala
[app.Builder.js] / tests / enum.vala
1 // compile
2 // valac   --pkg  gtk+-3.0  enum.vala   -o /tmp/enum
3 // ??--pkg javascriptcore \
4
5
6 int main (string[] args) {
7         Gtk.init(ref args);
8         var type = typeof(Gtk.Box);
9         var  ocl = (ObjectClass) type.class_ref ();
10         var ps = ocl.find_property("orientation");
11         var vt = ps.value_type;
12     EnumClass ec = (EnumClass) vt.class_ref ();
13         for (var i =0;i< ec.n_values; i++) {
14                 var ev = ec.values[i];
15                 print("%s : %d\n", ev.value_name,ev.value);
16         }
17          
18         return 0;
19 }
20