Cannot use GObject.ParamSpec overrides
I want to read the flags
of a paramspec.
GJS has a bunch of overrides for this https://gitlab.gnome.org/GNOME/gjs/-/blob/ba35b10b1b9d215c7ab9ce41e571e7313a32a62a/modules/core/overrides/GObject.js#L413
But when using find_property
or list_properties
; I get instances of GObject_ParamSpec
; not GObject.ParamSpec
so I cannot use the overrides.
Here is a simple reproducer to run with gjs -m
import GObject from "gi://GObject";
import Gtk from "gi://Gtk?version=4.0";
import Gdk from "gi://Gdk?version=4.0";
Gtk.init();
const object = Gdk.Display.get_default();
const paramspec = object.constructor.find_property("rgba");
console.log(paramspec.constructor); // function GObject_ParamSpec
console.log(paramspec.constructor instanceof GObject.ParamSpec); // false
console.log(paramspec.get_name()); // rgba
console.log(paramspec.name); // undefined
console.log(paramspec.flags); // undefined
Edited by Sonny Piers