Example: Get the type of a GObject

public class MyObject : Object {
}

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

 valac --pkg gobject-2.0 GLib.Object.get_type.vala

See:




2022 vala-language.org