[squeak-dev] The Trunk: Kernel-mt.1458.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 21 08:03:02 UTC 2022


Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1458.mcz

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

Name: Kernel-mt.1458
Author: mt
Time: 21 April 2022, 10:02:59.674461 am
UUID: f6c653af-39cf-6a4b-adb8-532953ba4c77
Ancestors: Kernel-tpr.1457

Fixes regerssion in choose-var dialog. Use list not buttons bc. there can be quite many instVars in a class.

=============== Diff against Kernel-tpr.1457 ===============

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.' ].
  	allVars := OrderedCollection new.
  	lines := OrderedCollection new.
  	labelStream := WriteStream on: (String new: 200).
  	self withAllSuperclasses do:
  		[ : class | | vars |
  		vars := class instVarNames , class theNonMetaClass 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 := Project uiManager
+ 		chooseFrom: (labelStream contents lines)
- 		chooseOptionFrom: (labelStream contents lines)
  		lines: lines
  		title: 'Variables in ' , self name.
  	index = 0 ifTrue: [ ^ self ].
  	aBlock value: (allVars at: index)!



More information about the Squeak-dev mailing list