Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread Stéphane Ducasse
I really think that NativeBoost MUST HAVE a decent documentation.
It is a central part of Pharo and Igor you should do something about it.
If I would know I would have written a chapter on it but I cannot because I DO 
NOT KNOW.

Stef

> 
> 
> 
> On 21 November 2013 22:40, Sean P. DeNigris  wrote:
> I'm wrapping the FMOD cross-platform audio library. The code is MIT and lives
> at http://smalltalkhub.com/#!/~SeanDeNigris/FMOD
> 
> 
> Problem #1:
> 
> 
> I'm calling into the FMOD library with:
> primStoreIsPlaying: channelHandle in: isPlayingHandle
> 
> 
> "FMOD_RESULT FMOD_Channel_IsPlaying(
> FMOD_CHANNEL *channel,
> bool *isplaying);"
> 
> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(NBExternalAddress
> channel, NBExternalAddress isPlayingHandle)).
> 
> I call the above with:
> isPlaying
> | isPlaying |
> isPlaying := NBExternalAddress new.
> self primStoreIsPlaying: channel in: isPlaying.
> ^ isPlaying value > 0.
> 
> isPlaying is always 0. The method works directly from C with:
> int isPlaying = 1;
> while (isPlaying) {
> FMOD_Channel_IsPlaying(channel, &isPlaying);
> }
> 
> I also tried changing the callout signature to "... bool* isPlayingHandle)"
> and passing "isPlaying := true." instead of using the NBExternalAddress
> stuff.
> 
> err.. again, you must pass an address where value will be stored, 
> 
> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(
> NBExternalAddress channel, NBExternalAddress * isPlayingHandle)).
> otherwise you passing NULL pointer, and i quite surprised it not segfaults 
> when you call it like that (looks like they have a check in the library )
>  
>  you can also use NBExternalTypeValue for that:
> 
> boolValueClass := NBExternalTypeValue ofType: 'bool'. "sure thing, creating 
> anonymous class for each call is overkill, this should be done once, 
> somewhere else"
> 
> boolValue := boolValueClass new.
> 
> self callTheThingWith: boolValue.
> 
> boolValue value ifTrue: [... blah]
> 
> (and this will work, assuming you have bool* in signature for this argument).
> 
> I have a few more questions, but this is the most pressing as it's holding
> up any further development.
> 
> Thanks!
> 
> 
> 
> -
> Cheers,
> Sean
> --
> View this message in context: 
> http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko.



Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread Stéphane Ducasse

On Nov 23, 2013, at 9:07 AM, Stéphane Ducasse  wrote:

> I really think that NativeBoost MUST HAVE a decent documentation.
> It is a central part of Pharo and Igor you should do something about it.
> If I would know I would have written a chapter on it but I cannot because I 
> DO NOT KNOW.

And igor do not tell me that only C programmer should use NativeBoost.
We should focus on our clients and our clients are smart Pharoers that can 
learn fast.

> 
> Stef
> 
>> 
>> 
>> 
>> On 21 November 2013 22:40, Sean P. DeNigris  wrote:
>> I'm wrapping the FMOD cross-platform audio library. The code is MIT and lives
>> at http://smalltalkhub.com/#!/~SeanDeNigris/FMOD
>> 
>> 
>> Problem #1:
>> 
>> 
>> I'm calling into the FMOD library with:
>> primStoreIsPlaying: channelHandle in: isPlayingHandle
>> 
>> 
>> "FMOD_RESULT FMOD_Channel_IsPlaying(
>> FMOD_CHANNEL *channel,
>> bool *isplaying);"
>> 
>> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(NBExternalAddress
>> channel, NBExternalAddress isPlayingHandle)).
>> 
>> I call the above with:
>> isPlaying
>> | isPlaying |
>> isPlaying := NBExternalAddress new.
>> self primStoreIsPlaying: channel in: isPlaying.
>> ^ isPlaying value > 0.
>> 
>> isPlaying is always 0. The method works directly from C with:
>> int isPlaying = 1;
>> while (isPlaying) {
>> FMOD_Channel_IsPlaying(channel, &isPlaying);
>> }
>> 
>> I also tried changing the callout signature to "... bool* isPlayingHandle)"
>> and passing "isPlaying := true." instead of using the NBExternalAddress
>> stuff.
>> 
>> err.. again, you must pass an address where value will be stored, 
>> 
>> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(
>> NBExternalAddress channel, NBExternalAddress * isPlayingHandle)).
>> otherwise you passing NULL pointer, and i quite surprised it not segfaults 
>> when you call it like that (looks like they have a check in the library )
>>  
>>  you can also use NBExternalTypeValue for that:
>> 
>> boolValueClass := NBExternalTypeValue ofType: 'bool'. "sure thing, creating 
>> anonymous class for each call is overkill, this should be done once, 
>> somewhere else"
>> 
>> boolValue := boolValueClass new.
>> 
>> self callTheThingWith: boolValue.
>> 
>> boolValue value ifTrue: [... blah]
>> 
>> (and this will work, assuming you have bool* in signature for this argument).
>> 
>> I have a few more questions, but this is the most pressing as it's holding
>> up any further development.
>> 
>> Thanks!
>> 
>> 
>> 
>> -
>> Cheers,
>> Sean
>> --
>> View this message in context: 
>> http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>> 
>> 
>> 
>> 
>> -- 
>> Best regards,
>> Igor Stasenko.
> 



Re: [Pharo-users] Cleaning up Voyage Documentation

2013-11-23 Thread Stéphane Ducasse
excellent 
we love co-authors

Stef

On Nov 20, 2013, at 9:04 PM, Johan Fabry  wrote:

> Hi all,
> 
> I am building a small app that uses Voyage and MongoDB as the database, and 
> so I had many questions regarding how to use it and found the documentation 
> lacking. After conversing with Esteban, I proposed that I improve the 'Pharo 
> for the enterprise' chapter on Voyage, based on his responses to my 
> questions. (See 
> https://ci.inria.fr/pharo-contribution/job/PharoForTheEnterprise/lastSuccessfulBuild/artifact/Voyage/Voyage.pier.html
>  and 
> https://github.com/SquareBracketAssociates/PharoForTheEnterprise-english/tree/master/Voyage
>  for the sources)
> 
> So a heads-up: I would like to take a 'lock' on that text for some days (to 
> avoid conflicts and the associated unpleasantness), as I go improving and 
> expanding it in the next few days. 
> 
> Also, if you have questions and/or remarks about Voyage and/or the 
> documentation, shoot! I will do my best to address them.
> 
> Greetings, 
> 
> ---> Save our in-boxes! http://emailcharter.org <---
> 
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile
> 
> 




Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .

2013-11-23 Thread Stéphane Ducasse
there are bezier algo in the system

Stef

On Nov 20, 2013, at 9:55 PM, kilon alios  wrote:

> yes I found the formula for straight lines and I was wondering what was the 
> one for bezier curves, so your reply could not have come a better moment. 
> Thanks I will study it and implement it. 
> 
> 
> On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes 
>  wrote:
> Hello,
> 
> You may want to calculate the distance between the mouse position and
> your path (I guess a bezier curve). Then given this distance and a
> tolerance to zero you decide if the mouse position is more or less on
> your path. Calculating the distance you will also get for free the place
> where to add a point on your path.
> 
> http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html
> 
> Hilaire
> 
> 
> Le 14/11/2013 21:07, kilon alios a écrit :
> > In order to do that I will have to check that the line passes through a
> > specific pixel. Or to be more correct that the place that mouse has
> > clicked is where my path passes through. How I do that ? Can Athens do
> > that ? Can athens tell me which pixels my path passes through ?
> >
> 
> 
> --
> Dr. Geo http://drgeo.eu
> 
> 
> 



Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread kilon alios
However we should acknowledge here that using a FFI, any FFI , in any
programming language has the mandatory requirement of knowing C. I
certainly do believe that documenting Nativeboost is extremely important
for helping people to port C libraries to pharo and making Pharo far more
useful but we should not kid ourselves. Coding with Nativeboost even though
its inside Pharo , even though its smalltalk syntax, even though it has the
tools to make your life easier, its still C coding or even Assembly coding
if you are brave enough to use the inline assembler.

I want to help with documentation the problem is that I dont know a lot of
stuff about Nativeboost besides the basic pointer things I did with
NBOpenGL.


On Sat, Nov 23, 2013 at 10:10 AM, Stéphane Ducasse <
stephane.duca...@inria.fr> wrote:

>
> On Nov 23, 2013, at 9:07 AM, Stéphane Ducasse 
> wrote:
>
> I really think that NativeBoost MUST HAVE a decent documentation.
> It is a central part of Pharo and Igor you should do something about it.
> If I would know I would have written a chapter on it but I cannot because
> I DO NOT KNOW.
>
>
> And igor do not tell me that only C programmer should use NativeBoost.
> We should focus on our clients and our clients are smart Pharoers that can
> learn fast.
>
>
> Stef
>
>
>
>
> On 21 November 2013 22:40, Sean P. DeNigris  wrote:
>
>> I'm wrapping the FMOD cross-platform audio library. The code is MIT and
>> lives
>> at http://smalltalkhub.com/#!/~SeanDeNigris/FMOD
>>
>> 
>> Problem #1:
>> 
>>
>> I'm calling into the FMOD library with:
>> primStoreIsPlaying: channelHandle in: isPlayingHandle
>> 
>>
>> "FMOD_RESULT FMOD_Channel_IsPlaying(
>> FMOD_CHANNEL *channel,
>> bool *isplaying);"
>>
>> ^ self nbCall: #(FMOD_RESULT
>> FMOD_Channel_IsPlaying(NBExternalAddress
>> channel, NBExternalAddress isPlayingHandle)).
>>
>> I call the above with:
>> isPlaying
>> | isPlaying |
>> isPlaying := NBExternalAddress new.
>> self primStoreIsPlaying: channel in: isPlaying.
>> ^ isPlaying value > 0.
>>
>> isPlaying is always 0. The method works directly from C with:
>> int isPlaying = 1;
>> while (isPlaying) {
>> FMOD_Channel_IsPlaying(channel, &isPlaying);
>> }
>>
>> I also tried changing the callout signature to "... bool*
>> isPlayingHandle)"
>> and passing "isPlaying := true." instead of using the NBExternalAddress
>> stuff.
>>
>> err.. again, you must pass an address where value will be stored,
>
> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(
>>
>> NBExternalAddress channel, NBExternalAddress * isPlayingHandle)).
>
> otherwise you passing NULL pointer, and i quite surprised it not segfaults
> when you call it like that (looks like they have a check in the library )
>
>  you can also use NBExternalTypeValue for that:
>
> boolValueClass := NBExternalTypeValue ofType: 'bool'. "sure thing,
> creating anonymous class for each call is overkill, this should be done
> once, somewhere else"
>
> boolValue := boolValueClass new.
>
> self callTheThingWith: boolValue.
>
> boolValue value ifTrue: [... blah]
>
> (and this will work, assuming you have bool* in signature for this
> argument).
>
> I have a few more questions, but this is the most pressing as it's holding
>> up any further development.
>>
>> Thanks!
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> View this message in context:
>> http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116.html
>> Sent from the Pharo Smalltalk Users mailing list archive at 
>> Nabble.com
>> .
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>
>
>
>


Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .

2013-11-23 Thread kilon alios
would I sound too lazy to ask in which class ?


On Sat, Nov 23, 2013 at 11:35 AM, Stéphane Ducasse <
stephane.duca...@inria.fr> wrote:

> there are bezier algo in the system
>
> Stef
>
> On Nov 20, 2013, at 9:55 PM, kilon alios  wrote:
>
> yes I found the formula for straight lines and I was wondering what was
> the one for bezier curves, so your reply could not have come a better
> moment. Thanks I will study it and implement it.
>
>
> On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes <
> hilaire.fernan...@gmail.com> wrote:
>
>> Hello,
>>
>> You may want to calculate the distance between the mouse position and
>> your path (I guess a bezier curve). Then given this distance and a
>> tolerance to zero you decide if the mouse position is more or less on
>> your path. Calculating the distance you will also get for free the place
>> where to add a point on your path.
>>
>> http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html
>>
>> Hilaire
>>
>>
>> Le 14/11/2013 21:07, kilon alios a écrit :
>> > In order to do that I will have to check that the line passes through a
>> > specific pixel. Or to be more correct that the place that mouse has
>> > clicked is where my path passes through. How I do that ? Can Athens do
>> > that ? Can athens tell me which pixels my path passes through ?
>> >
>>
>>
>> --
>> Dr. Geo http://drgeo.eu
>>
>>
>>
>
>


Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .

2013-11-23 Thread btc




kilon alios wrote:

  would I sound too lazy to ask in which class ?
  


yes. (but you usually are not lazy so you have some quota :)

I can't answer directly since Stef's post is the first I know of it, 
but a few interesting things turn up when I try World > Tools >
Finder searching for 'bezier' for
* Classes
* Selectors
* Source

cheers -ben


  

On Sat, Nov 23, 2013 at 11:35 AM, Stéphane Ducasse <
stephane.duca...@inria.fr> wrote:

  
  
there are bezier algo in the system

Stef

On Nov 20, 2013, at 9:55 PM, kilon alios  wrote:

yes I found the formula for straight lines and I was wondering what was
the one for bezier curves, so your reply could not have come a better
moment. Thanks I will study it and implement it.


On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes <
hilaire.fernan...@gmail.com> wrote:



  Hello,

You may want to calculate the distance between the mouse position and
your path (I guess a bezier curve). Then given this distance and a
tolerance to zero you decide if the mouse position is more or less on
your path. Calculating the distance you will also get for free the place
where to add a point on your path.

http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html

Hilaire


Le 14/11/2013 21:07, kilon alios a écrit :
  
  
In order to do that I will have to check that the line passes through a
specific pixel. Or to be more correct that the place that mouse has
clicked is where my path passes through. How I do that ? Can Athens do
that ? Can athens tell me which pixels my path passes through ?


  
  
--
Dr. Geo http://drgeo.eu



  



  
  
  







[Pharo-users] Deploying a polymorph app - two questions

2013-11-23 Thread kmo
I have written a small Polymorph application in Pharo 2.0. I have some
questions about deploying it.

My app consists of a single morph. I would like to fill the pharo window
with the morph and have the morph resize when the user resizes the pharo
window.

I'm pretty close to what I want. I have made my morph a subclass of
FullscreenMorph and it is filling the window nicely.

I just need two things.

One - I need to change the pharo window title to the title of my
application. I have tried DisplayScreen hostWindowTitle and it seems to have
no effect.

Two - I need to get rid of the Pharo window status bar - the one at the
bottom which shows you the various windows, browsers, and workspaces you
have open.

Can anyone give me some guidance?

Thanks.



--
View this message in context: 
http://forum.world.st/Deploying-a-polymorph-app-two-questions-tp4724525.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Deploying a polymorph app - two questions

2013-11-23 Thread Benjamin
On 23 Nov 2013, at 13:58, kmo  wrote:

> I have written a small Polymorph application in Pharo 2.0. I have some
> questions about deploying it.
> 
> My app consists of a single morph. I would like to fill the pharo window
> with the morph and have the morph resize when the user resizes the pharo
> window.
> 
> I'm pretty close to what I want. I have made my morph a subclass of
> FullscreenMorph and it is filling the window nicely.
> 
> I just need two things.
> 
> One - I need to change the pharo window title to the title of my
> application. I have tried DisplayScreen hostWindowTitle and it seems to have
> no effect.

In Spec, I use

DisplayScreen hostWindowTitle: aString, and it works.


> Two - I need to get rid of the Pharo window status bar - the one at the
> bottom which shows you the various windows, browsers, and workspaces you
> have open.

World changeProportionalLayout.
World
submorphs do: [:e | e delete ].
 
(Smalltalk at: #PolymorphSystemSettings) perform: #desktopColor: with: 
(Color r: 0.78 g: 0.753 b: 0.71).
((Smalltalk at: #UITheme) perform: #currentSettings) perform: 
#windowColor: with: (Color r: 0.745 g: 0.745 b: 0.745).
(Smalltalk at: #TaskbarMorph) perform: #showTaskbar: with: false

That’s what I do in Spec :)

For more info, you can have a look at WorldModel

Ben

> 
> Can anyone give me some guidance?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Deploying-a-polymorph-app-two-questions-tp4724525.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] Spec - Tutorial Series

2013-11-23 Thread Stéphane Ducasse


> When a Spec UI is build, the spec are looked up on class side.
> 
> But in some special cases you can provide directly a SpecLayout object to a 
> model.
> 
> 
> Why on class side? 
> The goal was to have a static description of a widget layout 

so that we can reuse it without to have to automatically create an instance.
> 
> Ben


Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .

2013-11-23 Thread kilon alios
aahhh come on ... I am not THAT lazy :D

of course I have searched it before asking. Unless I am blind I see loads
of bezier methods, none that detects whether a point belong to a curve. But
now you mention it I think I remember squeak was able to do add points to a
curve via click or something similar, because thats what I wan to do. So I
will take a look at it , most probably there is a method in there that does
this.

I want the user to click on a curve or line and there a new control point
will be placed that will allow the user to shape the line or curve to a
finer detail. A standard feature for all vector editors , 3d editors, even
image editors.

I am sorry if I miss something obvious here, its not laziness , its most
likely stupidity or just the fact I am very new with this. This is the
first time I try to make a vector editor.Again thank you all for trying to
help me, you have done already a lot.


On Sat, Nov 23, 2013 at 3:38 PM, Stéphane Ducasse  wrote:

>
>
> On Nov 23, 2013, at 11:24 AM, kilon alios  wrote:
>
> would I sound too lazy to ask in which class ?
>
>
> On Sat, Nov 23, 2013 at 11:35 AM, Stéphane Ducasse <
> stephane.duca...@inria.fr> wrote:
>
>> there are bezier algo in the system
>>
>> Stef
>>
>> On Nov 20, 2013, at 9:55 PM, kilon alios  wrote:
>>
>> yes I found the formula for straight lines and I was wondering what was
>> the one for bezier curves, so your reply could not have come a better
>> moment. Thanks I will study it and implement it.
>>
>>
>> On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes <
>> hilaire.fernan...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> You may want to calculate the distance between the mouse position and
>>> your path (I guess a bezier curve). Then given this distance and a
>>> tolerance to zero you decide if the mouse position is more or less on
>>> your path. Calculating the distance you will also get for free the place
>>> where to add a point on your path.
>>>
>>> http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html
>>>
>>> Hilaire
>>>
>>>
>>> Le 14/11/2013 21:07, kilon alios a écrit :
>>> > In order to do that I will have to check that the line passes through a
>>> > specific pixel. Or to be more correct that the place that mouse has
>>> > clicked is where my path passes through. How I do that ? Can Athens do
>>> > that ? Can athens tell me which pixels my path passes through ?
>>> >
>>>
>>>
>>> --
>>> Dr. Geo http://drgeo.eu
>>>
>>>
>>>
>>
>>
>
>
>


Re: [Pharo-users] Deploying a polymorph app - two questions

2013-11-23 Thread kmo
Benjamin - 

Many thanks.

Your suggestion of  World  submorphs do: [:e | e delete ] was just what I
needed to get rid of the taskbar.

However,  DisplayScreen hostWindowTitle does not work for me. I'm not using
Spec but surely that should make no difference. Is it a platform bug (I'm on
ubuntu 13.04) or are you using pharo 3.0? I'm on pharo 2.0 (there is no
WorldModel as far as I can see).

So, is DisplayScreen hostWindowTitle broken on pharo 2.0?

ken



--
View this message in context: 
http://forum.world.st/Deploying-a-polymorph-app-two-questions-tp4724525p4724550.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] spec and double click

2013-11-23 Thread Lorenz Köhl
I have a ListComposableModel rendered with spec that I want to do something if 
an element is double clicked.

How do I register the event handler? I know about on:send:to but what 
Announcement do I use? In my testing with just a symbol #doubleClick it doesn't 
work (and probably isn't supposed to).

thanks,
Lo


[Pharo-users] Making more memory available to VM on OS X.

2013-11-23 Thread nacho
Hi,
I'm doing some fractal drawings which requires a great number of iterations
and point drawing.
Once the given fractal set is rendered Pharo becomes very sluggish. Is there
a way to allocate more memory to the VM upon starting it?
thanks
Nacho




-
Nacho
Smalltalker apprentice.
Buenos Aires, Argentina.
--
View this message in context: 
http://forum.world.st/Making-more-memory-available-to-VM-on-OS-X-tp4724556.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread Denis Kudriashov
Hi

2013/11/22 Igor Stasenko 

>
>
>> 2. instead of returning useful objects, FMOD returns error codes and you
>> pass a pointer to receive the object.
>>
>> - The first consequence is that I have to wrap all the calls e.g. "self
>> processErrorCode: self primCreate." where
>> processErrorCode: anInteger
>> anInteger = 0 ifFalse: [ self error: 'FMOD returned error code ',
>> anInteger
>> asString ].
>> Is there a more graceful way to do that?
>>
>> i doubt so.. since it is library API which dictates you to use it in
> certain way.
> The proper error handling never hurts (except from causing extra code
> bloat, of course :)
>

Is it good idea to override (or create new) #nbCall: method to handle
library common logic? (when any library function returns error code)


Re: [Pharo-users] spec and double click

2013-11-23 Thread Stéphane Ducasse
> 
> I have a ListComposableModel rendered with spec that I want to do something 
> if an element is double clicked.

for double clicked I do not know.
Did you check the when* API of ListComposableModel?
> 
>   How do I register the event handler? I know about on:send:to

when:send:to:

> but what Announcement do I use? In my testing with just a symbol #doubleClick 
> it doesn't work (and probably isn't supposed to).

In which Pharo version are you?

> 
> thanks,
>   Lo




Re: [Pharo-users] Making more memory available to VM on OS X.

2013-11-23 Thread Ignacio Matías Sniechowski
Thanks for the attachments I will take a look at them.
The time it takes to render the fractal is not the problem. But after that,
if I want to drag or resize the window the fractal has been draw into, the
sluggish begins. Even with the fast dragging option checked. Also, closing
and opening other windows become sluggish.
thank
take care
Nacho



*Lic. Ignacio Sniechowski, MBA*






On Sat, Nov 23, 2013 at 1:40 PM, Stéphane Ducasse  wrote:

>
> On Nov 23, 2013, at 5:25 PM, nacho <0800na...@gmail.com> wrote:
>
> > Hi,
> > I'm doing some fractal drawings which requires a great number of
> iterations
> > and point drawing.
> > Once the given fractal set is rendered Pharo becomes very sluggish.
>
> This is strange. I can understand that pharo takes time to compute a
> fractal but I do not see why it would be sluggish after.
>
>
>
> > Is there
> > a way to allocate more memory to the VM upon starting it?
> > thanks
> > Nacho
> >
> >
> >
> >
> > -
> > Nacho
> > Smalltalker apprentice.
> > Buenos Aires, Argentina.
> > --
> > View this message in context:
> http://forum.world.st/Making-more-memory-available-to-VM-on-OS-X-tp4724556.html
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
>
>
>


Re: [Pharo-users] Making more memory available to VM on OS X.

2013-11-23 Thread Stéphane Ducasse
Probably because you should cache the result you get and not redraw it all the 
time.
You should control when you want to redraw it. So your Morph should hold a form 
or something like that.

Stef

On Nov 23, 2013, at 6:03 PM, Ignacio Matías Sniechowski <0800na...@gmail.com> 
wrote:

> Thanks for the attachments I will take a look at them.
> The time it takes to render the fractal is not the problem. But after that, 
> if I want to drag or resize the window the fractal has been draw into, the 
> sluggish begins. Even with the fast dragging option checked. Also, closing 
> and opening other windows become sluggish.
> thank
> take care
> Nacho
> 
> 
> Lic. Ignacio Sniechowski, MBA
> 
> 
> 
> 
> 
> 
> 
> On Sat, Nov 23, 2013 at 1:40 PM, Stéphane Ducasse  
> wrote:
> 
> On Nov 23, 2013, at 5:25 PM, nacho <0800na...@gmail.com> wrote:
> 
> > Hi,
> > I'm doing some fractal drawings which requires a great number of iterations
> > and point drawing.
> > Once the given fractal set is rendered Pharo becomes very sluggish.
> 
> This is strange. I can understand that pharo takes time to compute a fractal 
> but I do not see why it would be sluggish after.
> 
> 
> 
> > Is there
> > a way to allocate more memory to the VM upon starting it?
> > thanks
> > Nacho
> >
> >
> >
> >
> > -
> > Nacho
> > Smalltalker apprentice.
> > Buenos Aires, Argentina.
> > --
> > View this message in context: 
> > http://forum.world.st/Making-more-memory-available-to-VM-on-OS-X-tp4724556.html
> > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >
> 
> 
> 



Re: [Pharo-users] spec and double click

2013-11-23 Thread Lorenz Köhl
> Did you check the when* API of ListComposableModel?

Yes,  the closest thing might be whenSelectionChanged but nothing regarding 
click events as I see it.

>> 
>>  How do I register the event handler? I know about on:send:to
> 
> when:send:to:

In my ComposableModel the ListComposable model is 'attributes' so I did in 
initializeWidgets:

attributes when: #doubleClick send: #onDoubleClick to: self.

where the method logs to the transcript. But nothing shows up on a double click.

I suspect that spec has to setup the morphs it creates for handling 
(double)clicks and maybe it doesn't?

> In which Pharo version are you?
Latest 2.0

greetings,
Lo




Re: [Pharo-users] spec and double click

2013-11-23 Thread Stéphane Ducasse

On Nov 23, 2013, at 6:55 PM, Lorenz Köhl  wrote:

>> Did you check the when* API of ListComposableModel?
> 
> Yes,  the closest thing might be whenSelectionChanged but nothing regarding 
> click events as I see it.
> 
>>> 
>>> How do I register the event handler? I know about on:send:to
>> 
>> when:send:to:
> 
> In my ComposableModel the ListComposable model is 'attributes' so I did in 
> initializeWidgets:
> 
>   attributes when: #doubleClick send: #onDoubleClick to: self.
> 
> where the method logs to the transcript. But nothing shows up on a double 
> click.
> 
> I suspect that spec has to setup the morphs it creates for handling 
> (double)clicks and maybe it doesn't?
> 
>> In which Pharo version are you?
>   Latest 2.0

I strongly suggest to use 30 because spec changed a lot.

> 
> greetings,
>   Lo
> 
> 




Re: [Pharo-users] spec and double click

2013-11-23 Thread Lorenz Köhl
> I strongly suggest to use 30 because spec changed a lot.

Doesn't seem to work either (on yesterdays 30):

| m |
m := ListModel new items: #(a b c).
m when: #doubleClick send: #traceCr to: Transcript.
m on: #doubleClick send: #traceCr to: Transcript.
 "need doubleclick announcement?"
m openWithSpec

Maybe there's some spec mechanism for adding the EventHandler stuff
to the morphs it creates?

greetings,
Lo




Re: [Pharo-users] Deploying a polymorph app - two questions

2013-11-23 Thread Benjamin
On 23 Nov 2013, at 16:13, kmo  wrote:

> Benjamin - 
> 
> Many thanks.
> 
> Your suggestion of  World  submorphs do: [:e | e delete ] was just what I
> needed to get rid of the taskbar.
> 
> However,  DisplayScreen hostWindowTitle does not work for me. I'm not using
> Spec but surely that should make no difference. Is it a platform bug (I'm on
> ubuntu 13.04) or are you using pharo 3.0? I'm on pharo 2.0 (there is no
> WorldModel as far as I can see).
> 
> So, is DisplayScreen hostWindowTitle broken on pharo 2.0?

Might be, I am on mac + Pharo 3.0 and it works.

And I think that the Pharo Launcher uses this feature too and works on ubuntu.

So probably a problem in 2.0, or you are using an old vm maybe

Ben
> 
> ken
> 
> 
> 
> --
> View this message in context: 
> http://forum.world.st/Deploying-a-polymorph-app-two-questions-tp4724525p4724550.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 




Re: [Pharo-users] spec and double click

2013-11-23 Thread Benjamin
m := NewListModel new
m doubleClickAction: [ self halt ]

m openWithSpec


This should work

Ben

On 23 Nov 2013, at 19:23, Lorenz Köhl  wrote:

>> I strongly suggest to use 30 because spec changed a lot.
> 
> Doesn't seem to work either (on yesterdays 30):
> 
> | m |
> m := ListModel new items: #(a b c).
> m when: #doubleClick send: #traceCr to: Transcript.
> m on: #doubleClick send: #traceCr to: Transcript.
> "need doubleclick announcement?"
> m openWithSpec
> 
> Maybe there's some spec mechanism for adding the EventHandler stuff
> to the morphs it creates?
> 
> greetings,
>   Lo
> 
> 



Re: [Pharo-users] Deploying a polymorph app - two questions

2013-11-23 Thread kmo
Does not work in pharo 3.0 either on my ubuntu system.

My VM is dated 13/03/2013. I don't think I'm using a particularly old one.

Ken







--
View this message in context: 
http://forum.world.st/Deploying-a-polymorph-app-two-questions-tp4724525p4724580.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Writing a GUI - Where to start?

2013-11-23 Thread Picci Pharo
Typical Window := Window with buttons and textInput

> From: step...@stack.nl
> Date: Fri, 22 Nov 2013 16:35:09 +0100
> To: pharo-users@lists.pharo.org
> Subject: Re: [Pharo-users] Writing a GUI - Where to start?
> 
> >About Glamour, isn'it used to create Browser? How can i create a typical 
> >window?
> 
> What is a typical window? Spec gives too much freedom and not enough
> structure for 'typical’ applications.
> 
> Almost every window in your smalltalk system is a browser. 
> Nearly all would be significantly less code when build with Glamour.
> 
> Stephan
  

[Pharo-users] Merchandise in your locale

2013-11-23 Thread Jeff Gray
Just a reminder to have a look in the Pharo store. There are a number of
sites around the globe to allow you to shop in your language and to reduce
postage charges:

USA (English)   http://www.zazzle.com
USA (Español)   http://www.zazzle.com/?lang=es
Canada (English)http://www.zazzle.ca
Canada (Français)   http://www.zazzle.ca/?lang=fr
UK  http://www.zazzle.co.uk
Deutschland http://www.zazzle.de
España  http://www.zazzle.es
France  http://www.zazzle.fr
Portugalhttp://www.zazzle.pt
Sverige http://www.zazzle.se
Nederland   http://www.zazzle.nl
Österreich  http://www.zazzle.at
Schweiz (Deutsch)   http://www.zazzle.ch
Suisse (Français)   http://www.zazzle.ch/?lang=fr
Belgique (Français) http://www.zazzle.be
België (Nederlandse)http://www.zazzle.be/?lang=nl
Australia   http://www.zazzle.com.au
New Zealand http://www.zazzle.co.nz
日本  http://www.zazzle.co.jp
대한민국http://www.zazzle.co.kr
Brasil  http://www.zazzle.com.br
 



--
View this message in context: 
http://forum.world.st/Merchandise-in-your-locale-tp4724632.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Merchandise in your locale

2013-11-23 Thread Jeff Gray
Silly me. If you use these links you go straight to the shop!

USA (English)   http://www.zazzle.com/pharoshop
USA (Español)   http://www.zazzle.com/pharoshop/?lang=es
Canada (English)http://www.zazzle.ca/pharoshop
Canada (Français)   http://www.zazzle.ca/pharoshop/?lang=fr
UK  
http://www.zazzle.co.uk/pharoshop
Deutschland http://www.zazzle.de/pharoshop
España  http://www.zazzle.es/pharoshop
France  http://www.zazzle.fr/pharoshop
Portugalhttp://www.zazzle.pt/pharoshop
Sverige http://www.zazzle.se/pharoshop
Nederland   http://www.zazzle.nl/pharoshop
Österreich  http://www.zazzle.at/pharoshop
Schweiz (Deutsch)   http://www.zazzle.ch/pharoshop
Suisse (Français)   http://www.zazzle.ch/pharoshop/?lang=fr
Belgique (Français) http://www.zazzle.be/pharoshop
België (Nederlandse)http://www.zazzle.be/pharoshop/?lang=nl
Australia   http://www.zazzle.com.au/pharoshop
New Zealand http://www.zazzle.co.nz/pharoshop
日本  http://www.zazzle.co.jp/pharoshop
대한민국http://www.zazzle.co.kr/pharoshop
Brasil  http://www.zazzle.com.br/pharoshop  




--
View this message in context: 
http://forum.world.st/Merchandise-in-your-locale-tp4724632p4724640.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Mugs, mouse mats, stickers

2013-11-23 Thread Jeff Gray
What else would you like in the Pharo store?
Personally I'd like to have a t-shirt.



--
View this message in context: 
http://forum.world.st/Mugs-mouse-mats-stickers-tp4724644.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



[Pharo-users] Nautilus pkg-pane regression in pharo 3.0?

2013-11-23 Thread Lorenz Köhl
Nautilus has stopped jumping to packages when the focus is in the package pane 
and keys are pressed (the same behaviour use from eg. osx finder)

Is that a regression or intended?


Re: [Pharo-users] spec and double click

2013-11-23 Thread Lorenz Köhl

On Nov 23, 2013, at 7:37 PM, Benjamin  
wrote:

> m := NewListModel new
> m doubleClickAction: [ self halt ]
> 
> m openWithSpec

your code and the following (double clicking the list items) doesn't work for 
me in Pharo3.0
Latest update: #30591

m := NewListModel new items: #(a b c).
m doubleClickAction: [ Transcript traceCr: 'foo' ].
m openWithSpec


Re: [Pharo-users] Nautilus pkg-pane regression in pharo 3.0?

2013-11-23 Thread Benjamin
That a major issue so far.

It was not intended, but since the tree widget already handle arrow right by 
itself,
I do not know if Esteban thought about this feature

Ben

On 23 Nov 2013, at 22:34, Lorenz Köhl  wrote:

> Nautilus has stopped jumping to packages when the focus is in the package 
> pane and keys are pressed (the same behaviour use from eg. osx finder)
> 
> Is that a regression or intended?



Re: [Pharo-users] spec and double click

2013-11-23 Thread Benjamin
I will have a look tomorrow :)

If you are in a hurry, I know such a behaviour is present in EyeInspector

Ben

On 24 Nov 2013, at 00:07, Lorenz Köhl  wrote:

> 
> On Nov 23, 2013, at 7:37 PM, Benjamin  
> wrote:
> 
>> m := NewListModel new
>> m doubleClickAction: [ self halt ]
>> 
>> m openWithSpec
> 
> your code and the following (double clicking the list items) doesn't work for 
> me in Pharo3.0
> Latest update: #30591
> 
> m := NewListModel new items: #(a b c).
> m doubleClickAction: [ Transcript traceCr: 'foo' ].
> m openWithSpec



Re: [Pharo-users] [Athens] Finding if a line passes through a specific pixel .

2013-11-23 Thread Igor Stasenko
There is some bits which can help you in this regard.
The part of it is path tesseleration, which turns any path with complex
curves
into polygon (which has only straight lines),
from there on, i think you can easily calculate the distance between any
point and that polygon.
Look at AthensCurveFlattener class, and its uses.
the entry point is (flattenPath: aPath transform: aTransformation).

But be aware that this is not fully integrated yet and subject to change in
future.



On 23 November 2013 15:20, kilon alios  wrote:

> aahhh come on ... I am not THAT lazy :D
>
> of course I have searched it before asking. Unless I am blind I see loads
> of bezier methods, none that detects whether a point belong to a curve. But
> now you mention it I think I remember squeak was able to do add points to a
> curve via click or something similar, because thats what I wan to do. So I
> will take a look at it , most probably there is a method in there that does
> this.
>
> I want the user to click on a curve or line and there a new control point
> will be placed that will allow the user to shape the line or curve to a
> finer detail. A standard feature for all vector editors , 3d editors, even
> image editors.
>
> I am sorry if I miss something obvious here, its not laziness , its most
> likely stupidity or just the fact I am very new with this. This is the
> first time I try to make a vector editor.Again thank you all for trying to
> help me, you have done already a lot.
>
>
> On Sat, Nov 23, 2013 at 3:38 PM, Stéphane Ducasse <
> stephane.duca...@inria.fr> wrote:
>
>
>>
>> On Nov 23, 2013, at 11:24 AM, kilon alios  wrote:
>>
>> would I sound too lazy to ask in which class ?
>>
>>
>> On Sat, Nov 23, 2013 at 11:35 AM, Stéphane Ducasse <
>> stephane.duca...@inria.fr> wrote:
>>
>>> there are bezier algo in the system
>>>
>>> Stef
>>>
>>> On Nov 20, 2013, at 9:55 PM, kilon alios  wrote:
>>>
>>> yes I found the formula for straight lines and I was wondering what was
>>> the one for bezier curves, so your reply could not have come a better
>>> moment. Thanks I will study it and implement it.
>>>
>>>
>>> On Wed, Nov 20, 2013 at 9:21 PM, Hilaire Fernandes <
>>> hilaire.fernan...@gmail.com> wrote:
>>>
 Hello,

 You may want to calculate the distance between the mouse position and
 your path (I guess a bezier curve). Then given this distance and a
 tolerance to zero you decide if the mouse position is more or less on
 your path. Calculating the distance you will also get for free the place
 where to add a point on your path.

 http://blog.gludion.com/2009/08/distance-to-quadratic-bezier-curve.html

 Hilaire


 Le 14/11/2013 21:07, kilon alios a écrit :
 > In order to do that I will have to check that the line passes through
 a
 > specific pixel. Or to be more correct that the place that mouse has
 > clicked is where my path passes through. How I do that ? Can Athens do
 > that ? Can athens tell me which pixels my path passes through ?
 >


 --
 Dr. Geo http://drgeo.eu



>>>
>>>
>>
>>
>>
>


-- 
Best regards,
Igor Stasenko.


Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread Igor Stasenko
On 23 November 2013 17:42, Denis Kudriashov  wrote:

> Hi
>
> 2013/11/22 Igor Stasenko 
>
>>
>>
>>> 2. instead of returning useful objects, FMOD returns error codes and you
>>> pass a pointer to receive the object.
>>>
>>> - The first consequence is that I have to wrap all the calls e.g. "self
>>> processErrorCode: self primCreate." where
>>> processErrorCode: anInteger
>>> anInteger = 0 ifFalse: [ self error: 'FMOD returned error code
>>> ', anInteger
>>> asString ].
>>> Is there a more graceful way to do that?
>>>
>>> i doubt so.. since it is library API which dictates you to use it in
>> certain way.
>> The proper error handling never hurts (except from causing extra code
>> bloat, of course :)
>>
>
> Is it good idea to override (or create new) #nbCall: method to handle
> library common logic? (when any library function returns error code)
>

of course, the #nbCall: is just a convenience method and meant to be
overridden if necessary.

nbCall: fnSpec
" you can override this method if you need to"

^ (self nbCalloutIn: thisContext sender)
convention: self nbCallingConvention;
function: fnSpec module: self nbLibraryNameOrHandle

And  nbCallingConvention, nbLibraryNameOrHandle is there for override as
well.

A more verbose form is:

self nbCallout
stdcall;
options: #( - optDirectProxyFnAddress optAllowExternalAddressPtr);
function: #( NBBootstrapUlong HeapAlloc (ulong heapHandle , 0 ,
SIZE_T size) ) module: #Kernel32

But be aware though, that this code usually invoked once during code
generation,
and later no method code is invoked because it just runs a primitive
(primitiveNativeCall), and if it succeeds, it just returns with result,
without running a method's body.
So, nbcall can be changed/extended if you need extra thing at code
generation stage,
or you want to handle primitive error(s) differently.
But not for handling things like function return values (which happens to
be a library's error/success code).

-- 
Best regards,
Igor Stasenko.


Re: [Pharo-users] NativeBoost Questions while wrapping FMOD

2013-11-23 Thread Igor Stasenko
On 23 November 2013 09:07, Stéphane Ducasse wrote:

> I really think that NativeBoost MUST HAVE a decent documentation.
>

i agree. i need to invest into it.


> It is a central part of Pharo and Igor you should do something about it.
> If I would know I would have written a chapter on it but I cannot because
> I DO NOT KNOW.
>
> Stef
>
>
>
>
> On 21 November 2013 22:40, Sean P. DeNigris  wrote:
>
>> I'm wrapping the FMOD cross-platform audio library. The code is MIT and
>> lives
>> at http://smalltalkhub.com/#!/~SeanDeNigris/FMOD
>>
>> 
>> Problem #1:
>> 
>>
>> I'm calling into the FMOD library with:
>> primStoreIsPlaying: channelHandle in: isPlayingHandle
>> 
>>
>> "FMOD_RESULT FMOD_Channel_IsPlaying(
>> FMOD_CHANNEL *channel,
>> bool *isplaying);"
>>
>> ^ self nbCall: #(FMOD_RESULT
>> FMOD_Channel_IsPlaying(NBExternalAddress
>> channel, NBExternalAddress isPlayingHandle)).
>>
>> I call the above with:
>> isPlaying
>> | isPlaying |
>> isPlaying := NBExternalAddress new.
>> self primStoreIsPlaying: channel in: isPlaying.
>> ^ isPlaying value > 0.
>>
>> isPlaying is always 0. The method works directly from C with:
>> int isPlaying = 1;
>> while (isPlaying) {
>> FMOD_Channel_IsPlaying(channel, &isPlaying);
>> }
>>
>> I also tried changing the callout signature to "... bool*
>> isPlayingHandle)"
>> and passing "isPlaying := true." instead of using the NBExternalAddress
>> stuff.
>>
>> err.. again, you must pass an address where value will be stored,
>
> ^ self nbCall: #(FMOD_RESULT FMOD_Channel_IsPlaying(
>>
>> NBExternalAddress channel, NBExternalAddress * isPlayingHandle)).
>
> otherwise you passing NULL pointer, and i quite surprised it not segfaults
> when you call it like that (looks like they have a check in the library )
>
>  you can also use NBExternalTypeValue for that:
>
> boolValueClass := NBExternalTypeValue ofType: 'bool'. "sure thing,
> creating anonymous class for each call is overkill, this should be done
> once, somewhere else"
>
> boolValue := boolValueClass new.
>
> self callTheThingWith: boolValue.
>
> boolValue value ifTrue: [... blah]
>
> (and this will work, assuming you have bool* in signature for this
> argument).
>
> I have a few more questions, but this is the most pressing as it's holding
>> up any further development.
>>
>> Thanks!
>>
>>
>>
>> -
>> Cheers,
>> Sean
>> --
>> View this message in context:
>> http://forum.world.st/NativeBoost-Questions-while-wrapping-FMOD-tp4724116.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>
>
>


-- 
Best regards,
Igor Stasenko.


Re: [Pharo-users] spec and double click

2013-11-23 Thread Lorenz Köhl

> If you are in a hurry, I know such a behaviour is present in EyeInspector

Thanks. I found handlesDoubleClick: true there and it works now

Lo




[Pharo-users] How to load the PetitPHPParser?

2013-11-23 Thread Hernán Morales Durand
Loading in Pharo 2.0 gives warning with lots of dependencies:

This package depends on the following classes:
  PPCompositeParserTest
  PPCompositeParser
You must resolve these dependencies before you will be able to load these
definitions:
  PPPHPCoreGrammar
...

I have used:

Gofer new
squeaksource: 'PetitPHPParser';
package: 'ConfigurationOfPetitPHPParser';
load.
(Smalltalk at: #ConfigurationOfPetitPHPParser) perform: #loadDefault.



Cheers,

Hernán


Re: [Pharo-users] How to load the PetitPHPParser?

2013-11-23 Thread Tudor Girba
>From the errors, it seems that you have to load PetitParser first.

Doru


On Sun, Nov 24, 2013 at 4:48 AM, Hernán Morales Durand <
hernan.mora...@gmail.com> wrote:

> Loading in Pharo 2.0 gives warning with lots of dependencies:
>
> This package depends on the following classes:
>   PPCompositeParserTest
>   PPCompositeParser
> You must resolve these dependencies before you will be able to load these
> definitions:
>   PPPHPCoreGrammar
> ...
>
> I have used:
>
> Gofer new
> squeaksource: 'PetitPHPParser';
> package: 'ConfigurationOfPetitPHPParser';
> load.
> (Smalltalk at: #ConfigurationOfPetitPHPParser) perform: #loadDefault.
>
>
>
> Cheers,
>
> Hernán
>



-- 
www.tudorgirba.com

"Every thing has its own flow"


Re: [Pharo-users] How to load the PetitPHPParser?

2013-11-23 Thread Hernán Morales Durand
Hi Doru,

I have tested loading PetitParser from the ConfigurationBrowser and
without, and it is the same.



2013/11/24 Tudor Girba 

> From the errors, it seems that you have to load PetitParser first.
>
> Doru
>
>
> On Sun, Nov 24, 2013 at 4:48 AM, Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
>
>> Loading in Pharo 2.0 gives warning with lots of dependencies:
>>
>> This package depends on the following classes:
>>   PPCompositeParserTest
>>   PPCompositeParser
>> You must resolve these dependencies before you will be able to load these
>> definitions:
>>   PPPHPCoreGrammar
>> ...
>>
>> I have used:
>>
>> Gofer new
>> squeaksource: 'PetitPHPParser';
>> package: 'ConfigurationOfPetitPHPParser';
>> load.
>> (Smalltalk at: #ConfigurationOfPetitPHPParser) perform: #loadDefault.
>>
>>
>>
>> Cheers,
>>
>> Hernán
>>
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>