bohonghuang / cl-gtk4

GTK4/Libadwaita/WebKit2 bindings for Common Lisp.
GNU Lesser General Public License v3.0
212 stars 9 forks source link

Support for Subclassing? #58

Open malcolmboyd opened 6 months ago

malcolmboyd commented 6 months ago

Hello! Thank you for your work on this project. I've been poking around learning lisp alongside gtk. It seems that most gtk 4 language bindings and tutorials seem to be structured around extending gtk types. Is this possible with the GObject binding cl-gtk4 uses?

Example library using subclasses

bohonghuang commented 6 months ago

I'm afraid this feature may be difficult to implement in the short term. Subclassing a GObject class is not a simple process, which is why many GTK bindings do not support this functionality. Furthermore, Lisp's object-oriented paradigm differs from that of Python and JavaScript, for example, with constructs like defmethod. In the future, I might delve into GObject subclassing and then integrate it into Lisp's object system using MOP.