The Spec Gtk bindings for Pharo
You need Gtk4!
And you need to put it at the same place of the Pharo.exe executable.
To simplify the process we created a VM bundled with all the DLL and resources needed to execute GTK+3
You can get it from: http://files.pharo.org/vm/pharo-spur64-headless/win/latest-win64-GTK.zip
NOTE: If you are running under cygwin subsystem, remember to chmod +x *. Libraries have to be executable!
You need Gtk4 (installed by brew because paths are fixed for now)
brew install gtk+4
You need to have Gtk4 installed (this should be already the case). You can verify with this command:
apt list --installed | grep gtk4
or
dnf list --installed | grep gtk4
You will need to remove some library files shipped with the Pharo VM:
rm ~/pharo/vm/lib/libfreetype.so* ~/pharo/vm/lib/libcairo*.so*
- Download a Pharo 12.0 image:
curl get.pharo.org/120 | bash
- Open your image using
./pharo-ui Pharo.imageand evaluate:
Metacello new
repository: 'github://pharo-spec/Spec-Gtk:gtk4';
baseline: 'SpecGtk';
onConflict: [ :e | e useIncoming ];
onUpgrade: [ :e | e useIncoming ];
ignoreImage;
loadAfter the execution, save the image, and quit.
Running GTK now requires the Pharo VM to be run in worker mode: ./pharo --worker Pharo.image.
In macOS, running the World in Morphic is not yet possible since the SDL loop will execute in the worker and assume Cocoa is in the same thread. It cannot work since Cocoa must run in the main thread.
The following code should open a small UI:
SpLabelPresenter new
application: (SpApplication new useBackend: #Gtk);
label: 'Hello, Gtk4';
open.Currently, only the low-level infrastructure is supported. Tools building based on solely Spec2/Gtk are under way. Be patient.