I have been trying to replicate the behaviour of an existing (non-Pharo, non-Smalltalk) application with Morphic. This provides grouping images in a workspace, and then switching between laying them out separately or "stacked" by double clicking on the group (or an image in it). When the group is stacked, it can be moved around as a single drag and drop operation. When the group is separated, dragging an image out of it removes it from the group. On the surface this looked like a perfect fit to the submorph tree. Unfortunately, as both the Morphic chapter in Pharo by Example and the intro document by Maloney make clear, if you enable double clicking (by answering true to #handlesMouseDown:), you are interfering with what Maloney calls the "default behaviour" of being able to drag a Morph around. How do I reinstate that behaviour if a group is clicked on and the double click does not happen? Neither document helps in explaining where that "default" can be found in the code. Thanks Markus
Markus Stumptner <mst@cs.unisa.edu.au> wrote:
How do I reinstate that behaviour if a group is clicked on and the double click does not happen? Neither document helps in explaining where that "default" can be found in the code.
Take a look at the code for the drag panels. I have some videos starting at https://vimeo.com/130781061 Iâm not sure the configurations are up to date for Pharo 7 Stephan
On Sun, 2 Jun 2019 at 00:18, Markus Stumptner <mst@cs.unisa.edu.au> wrote:
I have been trying to replicate the behaviour of an existing (non-Pharo, non-Smalltalk) application with Morphic. This provides grouping images in a workspace, and then switching between laying them out separately or "stacked" by double clicking on the group (or an image in it). When the group is stacked, it can be moved around as a single drag and drop operation. When the group is separated, dragging an image out of it removes it from the group.
On the surface this looked like a perfect fit to the submorph tree. Unfortunately, as both the Morphic chapter in Pharo by Example and the intro document by Maloney make clear, if you enable double clicking (by answering true to #handlesMouseDown:), you are interfering with what Maloney calls the "default behaviour" of being able to drag a Morph around.
How do I reinstate that behaviour if a group is clicked on and the double click does not happen? Neither document helps in explaining where that "default" can be found in the code.
Have you put a `self haltOnce` in #handlesMouseDown: ? I am far from an expert here, but the following may help: Three alternate ways of handling mouse events https://wiki.squeak.org/squeak/2477 http://squeak.preeminent.org/tut2007/html/078.html Check the Dragging section here... https://wiki.squeak.org/squeak/6194 Search for doubleclick here... https://course.ccs.neu.edu/com3230/squeak/SqueakMorphClassGuide.pdf a few more #handlesXXX methods... https://course.ccs.neu.edu/com3230/squeak/SqueakMouseControls.html cheers -ben
participants (3)
-
Ben Coman -
Markus Stumptner -
Stephan Eggermont