links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
How do I move a morph from one project to another?
Last updated at 2:33 pm UTC on 14 March 2019
Bob Arning
Mon, Apr 30, 2018 at 7:37 PM
To: squeak-dev@lists.squeakfoundation.org

Two options:

1. drop it into a shared flap and take it out on the other project

2. open an explorer on the morph and then
 (Project named: 'whatever') world addMorph: self

Moving a SystemWindow object

Tony Garnock-Jones
Mon, Apr 30, 2018 at 8:14 PM
Reply-To: The general-purpose Squeak developers list

How to add a menu entry to send a SystemWindow to another project

Stéphane Rollandin
Tue, May 1, 2018 at 3:10 PM
Reply-To: The general-purpose Squeak developers list
To: squeak-dev@lists.squeakfoundation.org
Reply | Reply to all | Forward | Print | Delete | Show original

Is there a magic menu item somewhere that I can send a morph to a specific project?

I have that in my muO images (such as the available at http://www.zogotounga.net/comp/squeak/muo/muO335.zip), it is an item from the red halo handle, "send to project..."

The implementation is


        | target |
        target := Project queryProject ifNil: [^ self].
        target world addMorph: self

Project class>>queryProject

        | selection nBack prev |
        selection := (Project buildJumpToMenu: CustomMenu new) startUpLeftFlush.

        selection ifNil: [^ nil].
        (selection beginsWith: '%back') ifTrue:
                [nBack := (selection copyFrom: 6 to: selection size) asNumber.
                prev := CurrentProject previousProject.
                1 to: nBack-1 do:
                        [:i | prev ifNotNil: [prev := prev previousProject]].
                prev ifNotNil: [^ prev]].
        selection = #parent ifTrue:
                [^ CurrentProject parent].
        ^ Project namedWithDepth: selection.

Project class>>buildJumpToMenu: menu

        | listed i  toAdd |
        listed := OrderedCollection with: CurrentProject.
        i := 0.

        CurrentProject isTopProject ifFalse:
                [self   addItem: CurrentProject parent name , ' (parent)'
                                toMenu: menu
                                selection: #parent
                                project: CurrentProject parent.
                  menu addLine].

        (Preferences alphabeticalProjectMenu
                                [Project allNamesAndProjects]
                                [Project hierarchyOfNamesAndProjects]) do:

                [:aPair |
                        toAdd := aPair last isCurrentProject
                                  [aPair first, ' (current)']
                                  [aPair first].
                        self    addItem: toAdd
                                toMenu: menu
                                selection: aPair first
                                project: aPair last].
        ^ menu

Bob Arning
Wed, May 2, 2018 at 10:25 AM
Reply-To: The general-purpose Squeak developers list
To: squeak-dev@lists.squeakfoundation.org

Sounds to me like the discussion has moved into the it-could-mean-just-about-anything stage. So far we have:
  • sending morphs from one project to another
  • perhaps selecting the destination based on some morph property
  • perhaps the receiving project could refuse to accept the morph
  • make the morph frontmost in the receiving project's world, unless that project doesn't even have a world

And other questions occur:

  • why limit this to morphs? Why not send arbitrary data from project to project?
  • is a morph a ui representation of some separate domain object? Where does the domain object live?
  • what if the sending project is in "grid-view mode" and the receiving project is in "list-view mode"? Does sending a specific morph make any sense?
  • why assume the morph would be installed in the world at the other end?
  • do we assume the morph must be deleted from the sending world? Dropping a morph on a PVM will send a copy to the other project.

This all started with a simple problem that had a simple answer. Then many answers appeared without a clear notion of what the problem is. Who has a real problem that happens several times a day that takes too long to do? DTSTTCPW, anyone?

DropZoneMorph allows to send a morph to another project.
See also EToyProjectHistoryMorph.