[Pharo-project] Wrong fix: Issue 2947: SmalltalkEditor doesn't handle ESC key.

Fernando olivero fernando.olivero at usi.ch
Mon Oct 4 10:40:41 EDT 2010


I argue that this fix is wrong, giving the morph logic to the Editor instead of the View ( the morph).
this conceptual problem, leads to having to ask for the Global ActiveEvent in the Editor>>offerMenuFromEsc:.

If you take a look at the already present method, which should be the one to be used.

Editor>>escapePressed 
	"The message is sent when the user hits esc"
	self announceEscape

Which allows the Morph to take care of the view related behavior.

So i propose reverting to this behavior:

Editor>>escapePressed 
	self morph escapePressed .
	^ false  

Then adding
TextMorph>>escapePressed
	self yellowButtonActivity: false.
TextMorphForEditView>>escapePressed
	self editView yellowButtonActivity: false  . 


Given that TextMorphForEditView is the only implementor of #editView, and following the logic in 
    TextEditor>>raiseContextMenu: 
    TextEditor>>offerMenuFromEsc: aKeyboardEvent
	 
The attached change set implements the fixes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101004/c986db2b/attachment-0001.html>


More information about the Pharo-dev mailing list