Thanks esteban I copied and pasted your email in the how to draft in Spec2 book.

S

On 1 May 2021, at 20:47, Esteban Lorenzano <estebanlm@netc.eu> wrote:

Hello,

Remember: every time you execute "pharo-ui" you are invoking the UI (as the last part of the name says). If you want to NOT have the UI, you need to execute "pharo" :

./pharo Pharo.Image eval RunGtk execute

BUT: this will not work because the image will evaluate "RunGtk execute" and then will exit (because it will evaluate it as a script). To avoid that you need to execute: 

./pharo Pharo.Image eval --no-quit "RunGtk execute"

That will work as you want.

BUT, this is not how executing Spec applications is envisaged :

I guess you defined an application (a children of SpApplication?) where you set your backend to make it a Gtk application ?
and you have override #start to do something like (MyPresenter newApplication: self) openWithSpec ?

In that case, you just need to define in your application class (say is named MyApplication) :

MyApplication class >> applicationName
    ^ 'gtkapp'

then, is enough to say:

./pharo Pharo.image run gtkapp

which would be the "canonical" way to do it :)

Esteban


On May 1 2021, at 1:12 pm, kmo <voxkmp@gmail.com> wrote:
After not lookng at it for I while, I tried the Gtk Spec bindings again on my
Xubuntu desktop and - this time - they worked. I was able to open a new
window using Spec-Gtk, the latest headless VM and the latest Pharo 9.
(Many thanks to all concerned).

But I've immediately hit the same issue as I've raised before with SLD
support (OSWindow) - it seems impossible to open a Gtk window without the
whole Pharo IDE being shown as well.

If I run the following command line -

./pharo-ui Pharo.Image eval RunGtk execute

I get the Pharo IDE and a GTK window opened

If I run

./pharo Pharo.Image eval RunGtk execute

I just get the string RunGtk returned. No window opens.

I presume this will work some time in the future. Otherwise what's the use
of Spec-Gtk (or OSWindow for that matter)? You might as well just use Spec
on Morphic.



--

--------------------------------------------
St��phane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, B��t.A, Park Plaza
Villeneuve d'Ascq 59650
France