3 ms·
I've seen an interesting demo a few weeks ago for calling GTK directly from CL without binding/libraries: (load "./demostuff") (defun gtkapp ()
by IronBacon 7y ago
I've seen an interesting demo a few weeks ago for calling GTK directly from CL without binding/libraries:
(load "./demostuff")
(defun gtkapp ()
(sb-int:set-floating-point-modes :traps '(:overflow :invalid))
(gapp testgtk
(window win testgtk "Test" 400 200)
(box v outerbox1 win)
(box v mainbox1 outerbox1)
(box h buttons1 mainbox1)
(box h numbox1 mainbox1)
(box h leftbuttons1 buttons1)
(text num1 "Press the OK button." numbox1)
(button b1nw "OK" leftbuttons1 (xtext num1 "Button pressed."))
(gtk_widget_show_all win))
(g_application_run testgtk 0 nil)
(g_object_unref testgtk))
This is enough to create a window with a button and a text object, in less than 20 lines.
The "demostuff" part contains a few function and macros that are used in the author's demo. The zip archive distributed in his GitHub page[0] also contains a dumped SBCL image at around 40 MB and a script to build it for people who want to try it without installing SBCL. Not small in absolute terms but, even without function tree-shaking, its size can be reduced with core compression to a little more than 10 MB (12MB on my Debian installation, your SBCL needs to be built with "--with-sb-core-compression"), anyway still an order of magnitude smaller than Electron... ^__^;
[0] https://github.com/mifpasoti/Gtk-Demos https://github.com/mifpasoti/Gtk-Demos