Restoring a Morph's Default Mouse Handling

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

Restoring a Morph's Default Mouse Handling

Sean P. DeNigris
Administrator
I always forget how to do this, so I added a chapter to the online book:

As soon as you define #handlesMouseDown: in your Morph subclass, you lose the default behavior where a morph is picked up when clicked on.

To restore this behavior, compile the following two methods in your morph class:

mouseDown: anEvent

        anEvent hand waitForClicksOrDrag: self event: anEvent.
startDrag: anEvent

        anEvent hand grabMorph: self.

http://book.pharo-project.org/book/LanguageAndLibraries/GUI/restoringdefaultmousehandling
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Restoring a Morph's Default Mouse Handling

Helene Bilbo
Thank you. Your Morphic hints are very welcome.
Best regards,
Helene.