Example: Get a type from a instance

public class MyClass : Object {
}

public static int main (string[] args) {
// Output: ``MyClass``
print ("%s\n", Type.from_instance (new MyClass ()).name ());
return 0;
}

 valac --pkg gobject-2.0 GLib.Type.from_instance.vala

See:




2022 vala-language.org