Shell>>create ; show

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

Shell>>create ; show

Günther Schmidt
Hi all,

I wanted to do something like:


sem := Semaphore new.
sh := Shell create.

sh when:#viewOpened send:#signal to:sem.

sh show.

sem wait.

....

some code ....


Well it's not working, because just about any when:#opened #activated or
whatever seemed right is already triggered at "Shell create" time.

What would be the right code?

Günther


Reply | Threaded
Open this post in threaded view
|

Re: Shell>>create ; show

Chris Uppal-3
Günther,

> Well it's not working, because just about any when:#opened #activated or
> whatever seemed right is already triggered at "Shell create" time.
>
> What would be the right code?

I haven't tried tracing though (too hot), but I remember that creating shells
is not very well factored to allow you to put code "inside" the operation.  (I
asked once for it to be opened up a bit).  So I think you'll just have to hack
it by calling the appropriate (most likely private) methods.

Alternatively, refactor so that the shell creates its own semaphore which your
external code then waits on.  Without knowing what you are doing, my guess is
that that is the better option.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Shell>>create ; show

Günther Schmidt
Chris,

thanks for checking into this and confirming what I began to suspect,
ie. that it's not possible out of the box.

Günther

Chris Uppal schrieb:

> Günther,
>
>> Well it's not working, because just about any when:#opened #activated or
>> whatever seemed right is already triggered at "Shell create" time.
>>
>> What would be the right code?
>
> I haven't tried tracing though (too hot), but I remember that creating shells
> is not very well factored to allow you to put code "inside" the operation.  (I
> asked once for it to be opened up a bit).  So I think you'll just have to hack
> it by calling the appropriate (most likely private) methods.
>
> Alternatively, refactor so that the shell creates its own semaphore which your
> external code then waits on.  Without knowing what you are doing, my guess is
> that that is the better option.
>
>     -- chris
>
>
>