Launching OSWindow windows when in headless mode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
kmo
Reply | Threaded
Open this post in threaded view
|

Launching OSWindow windows when in headless mode

kmo
I would like to launch my application main morph in an OS Window from a pharo image run in headless mode from the command line. But this just gives me a libSDL2 not found error. I'm using pharo 6 on linux.

Is it possible to use OSWindow to open windows from a headless image? I want my main application window to be an OS window rather than the pharo application window.

The big advantage of doing this (on linux at least) is that you have control over the title and size of the window. It is not possible to set the size and title of the pharo application image window in linux because of bugs. I thought launching my app in an OS Window might be a good workaround but it doesn't seem to work.


Reply | Threaded
Open this post in threaded view
|

Re: Launching OSWindow windows when in headless mode

Denis Kudriashov
Hi.

I played with such idea few month ago. And it was worked.

I use this script on Mac:

./pharo Pharo6... eval --no-quit "Author useAuthor: 'test' during: [ OSWindowWorldMorph new open]"

where "pharo" was script for headless run.

Maybe Author do not need anymore. There was issue around it.

I think your error (libSDL2 not found error) not depends on headless mode. And it would be same if you open external window from normal pharo UI. Try it in playground.

2016-12-26 15:16 GMT+01:00 kmo <[hidden email]>:
I would like to launch my application main morph in an OS Window from a pharo
image run in headless mode from the command line. But this just gives me a
libSDL2 not found error. I'm using pharo 6 on linux.

Is it possible to use OSWindow to open windows from a headless image? I want
my main application window to be an OS window rather than the pharo
application window.

The big advantage of doing this (on linux at least) is that you have control
over the title and size of the window. It is not possible to set the size
and title of the pharo application image window in linux because of bugs. I
thought launching my app in an OS Window might be a good workaround but it
doesn't seem to work.






--
View this message in context: http://forum.world.st/Launching-OSWindow-windows-when-in-headless-mode-tp4928139.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


kmo
Reply | Threaded
Open this post in threaded view
|

Re: Launching OSWindow windows when in headless mode

kmo
It's strange - if I run:

./pharo -headless Pharo6App.image eval "MyApp run"

then I get the error: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory

But the main pharo window opens up followed by my OS WIndow. So that works fine despite the seeming error,

But if I run

./pharo -headless Pharo6App.image eval "MyApp run"

then I get the same error but no window opens up at all.
kmo
Reply | Threaded
Open this post in threaded view
|

Re: Launching OSWindow windows when in headless mode

kmo
By the way your command line :

./pharo -headless Pharo6.image eval --no-quit "OSWindowWorldMorph new open"

works fine. So it must be something to do with how my window is opened. I have a method that is called from the eval command line

|a|
a:= AppMorph new.
a extent:1000@580.
a color: (Color r: 0.13 g: 0.13 b: 0.13 alpha: 1.0).
a sticky: true.
a openInExternalWindow.
a owner osWindow title: 'My App'.

perhaps the problem lies here. Perhaps I need to use the OSWindowWorldMorph