On Tue, Nov 13, 2018 at 3:02 PM Tony Houghton <
h realh co uk> wrote:
On Tue, Nov 13, 2018 at 11:35 AM Tony Houghton <
h realh co uk> wrote:
Yes, it does the job, but it seems a shame that I can't take advantage of all the facilities that should be available by using GObject with an OO language. I suppose a good way to proceed for now would be to compromise by deriving Typescript classes from GObject classes but assume that I can't override native virtual functions this way and use signals instead.
Yes, I saw the use of the vfunc_ prefix, but I figured that was something that registerClass sets up and overrides won't work properly without it. Or will vfuncs work and I only need to use registerClass to be able to add signals and properties etc?
You always need to use registerClass to inherit from a GObject class, or it simply won't work.
(Python gets around this requirement by having metaclasses, which register the GObject class when you create the class object. JS doesn't have these.)