Enter a project and *then* ...

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

Enter a project and *then* ...

Jim Rosenberg
I have some projects where I need to navigate among them via buttons. When
I apply the enter method to a project from a mouseUp: method from an object
in a different project, it works. But code in that method following

targetProject enter

is just not executed. It's as though entering a project completely
"reboots" code execution from inside that project.

How can I enter a project and then execute code from inside that project,
where the code is invoked from the "source" project?

This is all very puzzling, and seems like magic.

Here's an example of something that doesn't work. Bring up an explorer on
an object with an instance variable containing a project. Highlight the
project, and then doIt the following code:

self enter. PopUpMenu inform: 'Hoot'

If "self" refers to the same project, the Hoot message appears. But if
"self" refers to a different project, the project is entered but the 'Hoot'
doesn't happen. How do I do "project-spanning" code?

-Thanks, Jim

Reply | Threaded
Open this post in threaded view
|

Re: Enter a project and *then* ...

Andreas.Raab
Try this instead:

WorldState addDeferredUIMessage:[PopUpMenu inform: 'Hoot'].
self enter.

Cheers,
   - Andreas

Jim Rosenberg wrote:

> I have some projects where I need to navigate among them via buttons.
> When I apply the enter method to a project from a mouseUp: method from
> an object in a different project, it works. But code in that method
> following
>
> targetProject enter
>
> is just not executed. It's as though entering a project completely
> "reboots" code execution from inside that project.
>
> How can I enter a project and then execute code from inside that
> project, where the code is invoked from the "source" project?
>
> This is all very puzzling, and seems like magic.
>
> Here's an example of something that doesn't work. Bring up an explorer
> on an object with an instance variable containing a project. Highlight
> the project, and then doIt the following code:
>
> self enter. PopUpMenu inform: 'Hoot'
>
> If "self" refers to the same project, the Hoot message appears. But if
> "self" refers to a different project, the project is entered but the
> 'Hoot' doesn't happen. How do I do "project-spanning" code?
>
> -Thanks, Jim
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Enter a project and *then* ...

Jim Rosenberg
--On July 3, 2007 6:38:51 PM -0700 Andreas Raab <[hidden email]> wrote:

>> How do I do "project-spanning" code?

> Try this instead:
>
> WorldState addDeferredUIMessage:[PopUpMenu inform: 'Hoot'].
> self enter.

Thank you!! It works!

Umm, how is one supposed to "discover" this? (Other than by asking *here*,
of course ... :-))

Some things in Morphic are pretty easy to figure out for oneself, but
others are pretty esoteric. I'm totally in a murk regarding hands, for
instance. Is there such a thing as a tutorial on Morphic / World / Project
internals?

-Thanks, Jim