[Cuis-dev] Drag event

Hilaire Fernandes hfern at free.fr
Sat Feb 8 04:02:27 PST 2025


Is there any reason drag event is not implemented as a property?

1
2
3
4

	

Morph>>dragEvent: aMouseEvent localPosition: aPoint

	aMouseEvent hand halo: nil.
	aMouseEvent hand grabMorph: self

contrary to other mouse events as :

1
2
3
4
5
6
7
8

	

Morph>>mouseButton1Down: aMouseButtonEvent localPosition: localEventPosition
	"Handle a mouse down event.
This message will only be sent to Morphs that answer true to 
#handlesMouseDown:"
	
	"Allow instances to dynamically use properties for handling common events."
	self 
		valueOfProperty: #'mouseButton1Down:localPosition:' 
		ifPresentDo: [:handler | handler value: aMouseButtonEvent value: localEventPosition ]

If I am right it makes impossible to add programmatically drag event 
handler to arbitrary Morph. You will have to subclass such Morph to add 
the behavior you want.

Am I right or do I miss something?

Thanks

-- 
http://mamot.fr/@drgeo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250208/85386ce9/attachment.htm>


More information about the Cuis-dev mailing list