Button tracking Morph

subbukk subbukk at gmail.com
Thu May 24 18:39:14 UTC 2007


On Thursday 24 May 2007 9:49 pm, subbukk wrote:
> ButtonMorph>>handleListenEvent: evt
>         "process events here"
>
> BTW, EventStats and ShowEvents could have been implemented as listeners
> instead of hacking into the handler itself. Any reason why they were done
> that way?
Well, I tried to adapt SimpleSwitchMorph by adding handleEvent:

SimpleSwitchMorph>>handleEvent: anEvent
	| modifier |
	modifier := '    '.
	anEvent anyModifierKeyPressed ifTrue: [
		anEvent commandKeyPressed ifTrue: [ modifier := 'Alt' ].
		anEvent controlKeyPressed ifTrue: [ modifier := modifier, ' Ctrl' ].
		anEvent shiftPressed ifTrue: [ modifier := modifier, ' Shift' ].
	].
	self label: modifier.

I was able to pick a sample instance of this morph and place it in the world. 
But after the first halo click, all morphs stopped responding to mouse 
events :-o. Alt-. shows the system stuck in processEvents. Without Morphic 
responses, I am unable to debug further.  Appending a "super handleEvent: 
evt" in the end of this method doesn't solve the problem.

Any help is appreciated .. Subbu



More information about the Squeak-dev mailing list