[Newbies] Re: Programmatically simulating drag and drop

Sean P. DeNigris sean at clipperadams.com
Sun May 2 02:10:06 UTC 2010


I did a little more investigating and found a way to get the mouse handlers
to work:
	mvevt := MouseMoveEvent new 
		setType: #mouseMove 
		startPoint: ActiveHand position 
		endPoint: 100 at 100
		trail: nil 
		buttons: 0 
		hand: ActiveHand 
		stamp: TimeStamp current.
		
	ActiveHand handleEvent: mvevt.

	evt := MouseButtonEvent new
		setType: #mouseDown 
		position: 50 at 50 
		which: MouseEvent redButton 
		buttons: MouseEvent redButton 
		hand: ActiveHand
		stamp: TimeStamp current.
	
	ActiveHand handleEvent: evt.

The mouse move is necessary or the grabbed morph flies to wherever the hand
is, but even with this, if you touch the mouse after it's grabbed, it flies
there anyway.
-- 
View this message in context: http://forum.world.st/Programmatically-simulating-drag-and-drop-tp1752837p2122490.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.


More information about the Beginners mailing list