Hi Robert,

The following two work for me in Pharo 2.0

World announcer 
                on: WindowOpened 
                send: #value 
                to: [ Transcript show: 'A new window was opened'; cr ].
                
World announcer 
                on: WindowOpened 
                send: #value: 
                to: [ :announcement |
                        Transcript show: 'A new window was opened ', 
announcement printString; cr ].

Note the #value and #value: selectors, matching the zero and one argument 
blocks.

I would guess that opening the Inspector inside the block creates an infinite 
loop ;-)

Sven

On 19 Mar 2013, at 15:47, Robert Shiplett <grshipl...@gmail.com> wrote:

> Pharo 2.0
> HelpBrowser Announcements STEP 3 
> 
> QUOTE:
> 
> In Pharo there is a global called "World" pointing to the desktop morph. This 
> world also has an announcer we can use to demonstrate the features of the 
> framework:
> 
>       | announcer |
>       World announcer 
>               on: WindowOpened 
>               send: #value 
>               to: [ Transcript show: 'A new window was opened';cr].
> 
> So anytime a window is opened in the system a message is shown in the 
> transcript:
>               
>       Transcript open.
>       
>       | announcer |
>       World announcer 
>               on: WindowOpened 
>               send: #value 
>               to: [:ea | ea inspect. Transcript show: 'A new window was 
> opened';cr].
> 
> 


Reply via email to