On Tue, Nov 13, 2018 at 3:02 PM Tony Houghton <h...@realh.co.uk> wrote:

> On Tue, 13 Nov 2018 at 18:23, <philip.chime...@gmail.com> 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.
>>>
>>
>> You can override the virtual functions, but they all start with vfunc_.
>> You can find them in the documentation, for example Gtk.Widget's virtual
>> functions start here:
>> http://devdocs.baznga.org/gtk30~3.22.12/gtk.widget#vfunc-adjust_baseline_allocation
>>
>
> 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.)
_______________________________________________
javascript-list mailing list
javascript-list@gnome.org
https://mail.gnome.org/mailman/listinfo/javascript-list

Reply via email to