[squeak-dev] The Trunk: Kernel-bf.654.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 17 13:19:17 UTC 2011


Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-bf.654.mcz

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

Name: Kernel-bf.654
Author: bf
Time: 17 November 2011, 2:18:37.428 pm
UUID: d13de9a3-b2e6-403e-ac68-66d94cb15a79
Ancestors: Kernel-nice.653

- fix class vars not showing up in menu while a browser's class side is selected

=============== Diff against Kernel-nice.653 ===============

Item was changed:
  ----- Method: ClassDescription>>chooseVarThenDo: (in category 'instance variables') -----
  chooseVarThenDo: aBlock 
  	"Put up a menu of all the instance variables in the receiver, and when
  the user chooses one, evaluate aBlock with the chosen variable as its
  parameter."
  	| lines labelStream allVars index |
+ 	(self allInstVarNames size + self theNonMetaClass allClassVarNames size) = 0 ifTrue: [ ^ self inform: 'There are no variables.' ].
- 	(self allInstVarNames size + self allClassVarNames size) = 0 ifTrue: [ ^ self inform: 'There are no variables.' ].
  	allVars := OrderedCollection new.
  	lines := OrderedCollection new.
  	labelStream := WriteStream on: (String new: 200).
  	self withAllSuperclasses reverseDo:
  		[ : class | | vars |
+ 		vars := class instVarNames , class theNonMetaClass classVarNames.
- 		vars := class instVarNames , class classVarNames.
  		vars do:
  			[ : var | labelStream
  				 nextPutAll: var ;
  				 cr.
  			allVars add: var ].
  		vars isEmpty ifFalse: [ lines add: allVars size ] ].
  	labelStream skip: -1.
  	"cut last CR"
  	(lines size > 0 and: [ lines last = allVars size ]) ifTrue: [ lines removeLast ].
  	"dispense with inelegant line beneath last item"
  	index := UIManager default
  		chooseFrom: (labelStream contents subStrings: {Character cr})
  		lines: lines
  		title: 'Variables in ' , self name.
  	index = 0 ifTrue: [ ^ self ].
  	aBlock value: (allVars at: index)!




More information about the Squeak-dev mailing list