In fact I see that the problem is more into
how can I specify a menu item which returns a value that I specify without
passing a symbol
((7 to: 10) collect: [:n | 2 raisedTo: n]) do: [:r | aMenu add:
r printString action: r].
On Mar 11, 2013, at 1:28 PM, Stéphane Ducasse <[email protected]> wrote:
> HI guys
>
> I'm trying to fix all the sound interface for 2.0 and I got trapped into
> MenuMorph. How do I schedule a menu and get its selected value?
> I have to convert code like the following one.
>
>
>
> | aMenu sz on |
> 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 action: r].
>
> sz := aMenu popUpInWorld.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> how can I get the selected value?
>
>
> sz ifNil: [^ self].
> on := soundInput isRecording.
> self stop.
> fft := FFT new: sz.
> self resetDisplay.
> on ifTrue: [self start].
>
>