[Q] Alphabetize instance variables in inspectors and debugger

Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Fri Feb 16 13:20:21 UTC 2007


Must correct myself , the first what I send is not enough as selecting the
wished variable in Inspector gives the wrong value.

With this attached , works well.

I don't wish reinvent the wheel. If some better implementation exist, I wish
know.

If no answer in two weeks, I add as enhancement in Mantis.

Edgar

-------------- next part --------------
'From SqueakLight3.7.1 of ''4 September 2004'' [latest update: #5989] on 16 February 2007 at 10:13:57 am'!

!Inspector methodsFor: 'selecting' stamp: 'edc 2/16/2007 10:05'!
selection
	"The receiver has a list of variables of its inspected object.  
	One of these is selected. Answer the value of the selected  
	variable."
	| basicIndex varName |
	selectionIndex = 0
		ifTrue: [^ ''].
	selectionIndex = 1
		ifTrue: [^ object].
	selectionIndex = 2
		ifTrue: [^ object longPrintString].
	selectionIndex - 2 <= object class instSize
		ifTrue: [varName := object class allInstVarNames asSortedCollection at: selectionIndex - 2 .
			^ object instVarNamed: varName].
	basicIndex := selectionIndex - 2 - object class instSize.
	(object basicSize <= (self i1 + self i2)
			or: [basicIndex <= self i1])
		ifTrue: [^ object basicAt: basicIndex]
		ifFalse: [^ object basicAt: object basicSize - (self i1 + self i2) + basicIndex]! !


More information about the Squeak-dev mailing list