[etoys-dev] Etoys: Morphic-bf.30.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 8 07:42:26 EDT 2010

Bert Freudenberg uploaded a new version of Morphic to project Etoys:

==================== Summary ====================

Name: Morphic-bf.30
Author: bf
Time: 8 August 2010, 1:41:23 pm
UUID: 4dfcc577-1424-4327-852f-f6c490621d9a
Ancestors: Morphic-bf.29

- protect against nil owner in StringMorphEditor>>keyStroke: (which happens when the key hit actually deleted self)

=============== Diff against Morphic-bf.29 ===============

Item was changed:
  ----- Method: StringMorphEditor>>keyStroke: (in category 'event handling') -----
  keyStroke: evt
  	"This is hugely inefficient, but it seems to work, and it's unlikely it will ever need
  	to be any more efficient -- it's only intended to edit single-line strings."
  	| char newSel w |
  	(((char _ evt keyCharacter) = Character enter) or: [(char = Character cr)
  			or: [char = $s and: [evt commandKeyPressed]]])
  				ifTrue: [owner doneWithEdits; acceptContents.
  	self flag: #arNote. "Probably unnecessary"
  						evt hand releaseKeyboardFocus.
  						^ self delete].
  	(char = $l and: [evt commandKeyPressed]) ifTrue:   "cancel"
  		[owner cancelEdits.
  		evt hand releaseKeyboardFocus.
  		^ self delete].
  	super keyStroke: evt.
  	owner interimContents: self contents asString.
  	newSel _ self editor selectionInterval.
+ 	owner ifNotNil: [
+ 		w := owner fullBounds width.
+ 		self width: w + 1.
+ 		self width: w].
- 	w := owner fullBounds width.
- 	self width: w + 1.
- 	self width: w.
  	self textColor: self color.
  	self editor selectFrom: newSel first to: newSel last.

More information about the etoys-dev mailing list