Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Hilaire
Le 12/02/2015 17:12, Stephan Eggermont a écrit : Hilaire wrote: Okay if I understand correctly, the two morphs you want to link with a line are also morphs of yours? So you can mangle into them. I was supposing the two morphs to link could be arbitrary ones, i.e. ones you can't modify. I

Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Stephan Eggermont
Thanks Hilaire, that works fine. I can add the listener when the actual dragging starts and remove it on mouseUp. MDShapedoDrag: aMouseMoveEvent with: aMDShape ActiveHand addEventListener: self. aMouseMoveEvent hand startDrag: aMouseMoveEvent with: aMDShape.

Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Hilaire
Hi, Here is an implementation example. From a workspace, do: | morphA morphB follower | morphA := Morph new position: 10@10. morphB := Morph new position: 100@100. follower := FollowerLineMoprh from: morphA to: morphB. morphA openInWorld. morphB openInWorld. follower openInWorld. Frankly I

Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Hilaire
Le 12/02/2015 11:04, Stephan Eggermont a écrit : This works for me. I can attach the listener when the dragging starts, and detach it when it stops. That should do. Okay if I understand correctly, the two morphs you want to link with a line are also morphs of yours? So you can mangle into

Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Stephan Eggermont
On 12/02/15 10:20, Hilaire wrote: Frankly I don't like the idea to subscribe to the HandMorph, because at each mouse move event, you have to check for the morph A and B if they move. It is a waste of CPU cycles. Ideally you will want receive event from morph A and B whenever they changed. I

Re: [Pharo-users] Getting notified when a morph moves

2015-02-12 Thread Stephan Eggermont
Hilaire wrote: Okay if I understand correctly, the two morphs you want to link with a line are also morphs of yours? So you can mangle into them. I was supposing the two morphs to link could be arbitrary ones, i.e. ones you can't modify. I am trying to get a better understanding of Morphic by

[Pharo-users] Getting notified when a morph moves

2015-02-11 Thread Stephan Eggermont
I'm trying to keep a line morph connected between two morphs while moving one of them. When I add the morph to the hand and start dragging the morph no longer receives mouseMove:. I can think of several ways to get position updates. Is there a best/easy way? Stephan

Re: [Pharo-users] Getting notified when a morph moves

2015-02-11 Thread Aliaksei Syrel
Hi, I think you need to subscribe to the hand morph. It provides some possibilities. Of course if you drag morphs only inside it's parent, you can implement dragging by yourself without adding to hand. In this case mouseMove can be received. Cheers, Alex On Wed, Feb 11, 2015 at 9:19 PM, Stephan

Re: [Pharo-users] Getting notified when a morph moves

2015-02-11 Thread Hilaire
Le 11/02/2015 21:19, Stephan Eggermont a écrit : I'm trying to keep a line morph connected between two morphs while moving one of them. When I add the morph to the hand and start dragging the morph no longer receives mouseMove:. I can think of several ways to get position updates. Is