Primitive Failed error trying openInExternalWindow

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

Primitive Failed error trying openInExternalWindow

Eduardo de Oliveira Padoan
Hi, greetings!

I was trying out some examples from the Pharo By Example book on the latest development version of Pharo, and I wanted to create a stand-alone window for a simple game on Ubuntu. So I found out the openInExternalWindow method, the window appears but I get this error that I couldn't understand, and could not find any reference to it online. So I'm not sure if it's a bug.

The simplest way I found to reproduce it was:

'Hello' asMorph openInExternalWindow.

I'm using Pharo 7 on Ubuntu 17.10.

A copy of the stack:

ByteArray(Object)>>primitiveFailed:
ByteArray(Object)>>primitiveFailed
ByteArray>>integerAt:size:signed:
ByteArray>>unsignedLongAt:
SDL_KeyDownEvent>>windowID
OSSDL2Driver>>convertEvent:
[ event := self convertEvent: sdlEvent.
event ifNotNil: [ eventQueue nextPut: event ] ] in OSSDL2Driver>>processEvent: in Block: [ event := self convertEvent: sdlEvent....
BlockClosure>>on:do:
OSSDL2Driver>>processEvent:
OSSDL2Driver>>eventLoopProcessWithoutPlugin
[ self eventLoopProcessWithoutPlugin ] in OSSDL2Driver>>setupEventLoop in Block: [ self eventLoopProcessWithoutPlugin ]
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self value....

But it seems incomplete. Any more information I can provide?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Primitive Failed error trying openInExternalWindow

Stephane Ducasse-3
Hello Eduardo

this method is not done to be invoked like that. In the future Pharo
will move to SDL (in fact to OSWindow based on SDL or other
framework). Right now OSWindow is not ready to be really used.
Right now what you should do is resize the main window the the size of
your largest morph.
We should definitively invest more in the deployment of Application.

Stef

On Sat, Oct 21, 2017 at 6:28 PM, Eduardo de Oliveira Padoan
<[hidden email]> wrote:

> Hi, greetings!
>
> I was trying out some examples from the Pharo By Example book on the latest
> development version of Pharo, and I wanted to create a stand-alone window
> for a simple game on Ubuntu. So I found out the openInExternalWindow method,
> the window appears but I get this error that I couldn't understand, and
> could not find any reference to it online. So I'm not sure if it's a bug.
>
> The simplest way I found to reproduce it was:
>
> 'Hello' asMorph openInExternalWindow.
>
> I'm using Pharo 7 on Ubuntu 17.10.
>
> A copy of the stack:
>
> ByteArray(Object)>>primitiveFailed:
> ByteArray(Object)>>primitiveFailed
> ByteArray>>integerAt:size:signed:
> ByteArray>>unsignedLongAt:
> SDL_KeyDownEvent>>windowID
> OSSDL2Driver>>convertEvent:
> [ event := self convertEvent: sdlEvent.
> event ifNotNil: [ eventQueue nextPut: event ] ] in
> OSSDL2Driver>>processEvent: in Block: [ event := self convertEvent:
> sdlEvent....
> BlockClosure>>on:do:
> OSSDL2Driver>>processEvent:
> OSSDL2Driver>>eventLoopProcessWithoutPlugin
> [ self eventLoopProcessWithoutPlugin ] in OSSDL2Driver>>setupEventLoop in
> Block: [ self eventLoopProcessWithoutPlugin ]
> [ self value.
> Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self
> value....
>
> But it seems incomplete. Any more information I can provide?
>
> Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Primitive Failed error trying openInExternalWindow

Clément Béra
In reply to this post by Eduardo de Oliveira Padoan
Hi Eduardo,

Your FFIStructures are not initialised (I thought this was solved in latest Pharo 7 ? Maybe not integrated yet). Run:
FFIExternalStructure allSubclassesDo: #rebuildFieldAccessors.
Then your code should work.

I wrote a simple game using Pharo/SDL2/Cairo and it works very well (50fps without problems, responsiveness is really good, etc.), the ReadMe includes how to run it on Ubuntu/Mac OS X/Windows, check here:


Let me know if you have other questions.

On Sat, Oct 21, 2017 at 6:28 PM, Eduardo de Oliveira Padoan <[hidden email]> wrote:
Hi, greetings!

I was trying out some examples from the Pharo By Example book on the latest development version of Pharo, and I wanted to create a stand-alone window for a simple game on Ubuntu. So I found out the openInExternalWindow method, the window appears but I get this error that I couldn't understand, and could not find any reference to it online. So I'm not sure if it's a bug.

The simplest way I found to reproduce it was:

'Hello' asMorph openInExternalWindow.

I'm using Pharo 7 on Ubuntu 17.10.

A copy of the stack:

ByteArray(Object)>>primitiveFailed:
ByteArray(Object)>>primitiveFailed
ByteArray>>integerAt:size:signed:
ByteArray>>unsignedLongAt:
SDL_KeyDownEvent>>windowID
OSSDL2Driver>>convertEvent:
[ event := self convertEvent: sdlEvent.
event ifNotNil: [ eventQueue nextPut: event ] ] in OSSDL2Driver>>processEvent: in Block: [ event := self convertEvent: sdlEvent....
BlockClosure>>on:do:
OSSDL2Driver>>processEvent:
OSSDL2Driver>>eventLoopProcessWithoutPlugin
[ self eventLoopProcessWithoutPlugin ] in OSSDL2Driver>>setupEventLoop in Block: [ self eventLoopProcessWithoutPlugin ]
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self value....

But it seems incomplete. Any more information I can provide?

Thank you.



--
Clément Béra
Pharo consortium engineer
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
Reply | Threaded
Open this post in threaded view
|

Re: Primitive Failed error trying openInExternalWindow

Eduardo de Oliveira Padoan
In reply to this post by Stephane Ducasse-3
Thanks for the explanation Stef. It would probably be a good idea to have a kind of "reverse depreciation warning" in this method, as it seems like a newbie pitfall :P

Em dom, 22 de out de 2017 17:44, Stephane Ducasse <[hidden email]> escreveu:
Hello Eduardo

this method is not done to be invoked like that. In the future Pharo
will move to SDL (in fact to OSWindow based on SDL or other
framework). Right now OSWindow is not ready to be really used.
Right now what you should do is resize the main window the the size of
your largest morph.
We should definitively invest more in the deployment of Application.

Stef

On Sat, Oct 21, 2017 at 6:28 PM, Eduardo de Oliveira Padoan
<[hidden email]> wrote:
> Hi, greetings!
>
> I was trying out some examples from the Pharo By Example book on the latest
> development version of Pharo, and I wanted to create a stand-alone window
> for a simple game on Ubuntu. So I found out the openInExternalWindow method,
> the window appears but I get this error that I couldn't understand, and
> could not find any reference to it online. So I'm not sure if it's a bug.
>
> The simplest way I found to reproduce it was:
>
> 'Hello' asMorph openInExternalWindow.
>
> I'm using Pharo 7 on Ubuntu 17.10.
>
> A copy of the stack:
>
> ByteArray(Object)>>primitiveFailed:
> ByteArray(Object)>>primitiveFailed
> ByteArray>>integerAt:size:signed:
> ByteArray>>unsignedLongAt:
> SDL_KeyDownEvent>>windowID
> OSSDL2Driver>>convertEvent:
> [ event := self convertEvent: sdlEvent.
> event ifNotNil: [ eventQueue nextPut: event ] ] in
> OSSDL2Driver>>processEvent: in Block: [ event := self convertEvent:
> sdlEvent....
> BlockClosure>>on:do:
> OSSDL2Driver>>processEvent:
> OSSDL2Driver>>eventLoopProcessWithoutPlugin
> [ self eventLoopProcessWithoutPlugin ] in OSSDL2Driver>>setupEventLoop in
> Block: [ self eventLoopProcessWithoutPlugin ]
> [ self value.
> Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self
> value....
>
> But it seems incomplete. Any more information I can provide?
>
> Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Primitive Failed error trying openInExternalWindow

Eduardo de Oliveira Padoan
In reply to this post by Clément Béra
Thanks, I will try it. I will check your game too, I like learning from examples.

Em dom, 22 de out de 2017 18:14, Clément Bera <[hidden email]> escreveu:
Hi Eduardo,

Your FFIStructures are not initialised (I thought this was solved in latest Pharo 7 ? Maybe not integrated yet). Run:
FFIExternalStructure allSubclassesDo: #rebuildFieldAccessors.
Then your code should work.

I wrote a simple game using Pharo/SDL2/Cairo and it works very well (50fps without problems, responsiveness is really good, etc.), the ReadMe includes how to run it on Ubuntu/Mac OS X/Windows, check here:


Let me know if you have other questions.

On Sat, Oct 21, 2017 at 6:28 PM, Eduardo de Oliveira Padoan <[hidden email]> wrote:
Hi, greetings!

I was trying out some examples from the Pharo By Example book on the latest development version of Pharo, and I wanted to create a stand-alone window for a simple game on Ubuntu. So I found out the openInExternalWindow method, the window appears but I get this error that I couldn't understand, and could not find any reference to it online. So I'm not sure if it's a bug.

The simplest way I found to reproduce it was:

'Hello' asMorph openInExternalWindow.

I'm using Pharo 7 on Ubuntu 17.10.

A copy of the stack:

ByteArray(Object)>>primitiveFailed:
ByteArray(Object)>>primitiveFailed
ByteArray>>integerAt:size:signed:
ByteArray>>unsignedLongAt:
SDL_KeyDownEvent>>windowID
OSSDL2Driver>>convertEvent:
[ event := self convertEvent: sdlEvent.
event ifNotNil: [ eventQueue nextPut: event ] ] in OSSDL2Driver>>processEvent: in Block: [ event := self convertEvent: sdlEvent....
BlockClosure>>on:do:
OSSDL2Driver>>processEvent:
OSSDL2Driver>>eventLoopProcessWithoutPlugin
[ self eventLoopProcessWithoutPlugin ] in OSSDL2Driver>>setupEventLoop in Block: [ self eventLoopProcessWithoutPlugin ]
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self value....

But it seems incomplete. Any more information I can provide?

Thank you.



--
Clément Béra
Pharo consortium engineer