Closed rexkogitans closed 3 years ago
@rexkogitans I'm not sure exactly how it would be done, correctly. As it happens, there seems to be a bug making it so that the relevant methods don't exist.
@romgrk This is related to #283 (see later comments), where some methods aren't exposed
I tried to overly expose everything, but as I lack in time I could not go into deeper. In bootstrap.js, line 382 says
return undefined;
I replaced it by
return makeStruct(info);
Running the program ends in the same error as before.
Addendum; IMHO, the equivalent to pyobject's gi/_gtktemplate.py
is missing.
For now, there is no equivalent. PyGObject does some magic to make templates work, we're not at that stage yet.
To create a GTK4 application, the best model for now is node-gtk-template, in particular window.js for your use case.
Closing but don't hesitate if you have more questions.
Gtk 4 now uses templates to connect the event handlers mentioned in an XML UI file automatically. However, I need some help to understand how to do in JS. This is what I have come up with so far:
Can someone tell me what to do exactly in the constructor to load the XML UI data and connect the event handlers automatically?
Kind regards