On Mar 11, 2013, at 5:41 PM, stephane ducasse <stephane.ducasse@free.fr> wrote:


On Mar 11, 2013, at 2:10 PM, jannik laval <jannik.laval@gmail.com> wrote:

Hi Stef,

I am searching to do that too.
For now, I am using something else... And I plan to create new Menu more usable.

Here is what I use, for your case, just adapt it when trying:

===
        | aMenu sz on |
on := soundInput isRecording.
        self stop.
        aMenu := MenuMorph new title: ('FFT size (currently {1})' translated format:{fft n}).
        ((7 to: 10) collect: [:n | 2 raisedTo: n]) do: [:r | 
aMenu add: r printString 
target: FFT
selector: #new
argument: r
].

        aMenu popUpInWorld.
        
        self resetDisplay.
        on ifTrue: [self start].
===

the problem is that we are missing a way to have menu that simply return a value (without resorting to a method execution and selector).

Yes, I know :)
Try this small class. I named it MenuMorphNG.
You can use it like that:

===
menu := MenuMorphNG new defaultTarget: menu.
menu add: 'test1' value: #testForPharo.
menu addLine.
menu add: 'test2' value: 2.0.
menu localize; invokeModal.
menu selectedValue
===

Jannik