Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!brutus.cs.uiuc.edu!samsung!ginosko!uunet!mcsun!tuvie!gollman From: gollman@tuvie (Georg Gollman) Newsgroups: comp.lang.smalltalk Subject: St/V Mac fix Keywords: ClassHierarchyBrowser Message-ID: <992@tuvie> Date: 30 Oct 89 15:28:54 GMT Organization: TU Vienna EDP-Center, Vienna, AUSTRIA Lines: 65 My teeny weeny code donation ... Just a small fix to ClassHierarchyBrowser>>findClass in Smalltalk/V Mac R1.10. I added a check to make sure that the 'class' is really a class, otherwise searching for 'Memory' and things like that will produce a walkback. Georg Gollmann Please reply to: gollman@tuvie.at TU Wien, EDVZ or: gollmann@egh780.una.at ------------------------------- cut here ------------------------------ !ClassHierarchyBrowser methods ! findClass "Prompt for a class to search for, and position at that point in the hierarchy." | className class supers blanks result | result := pane saveChanges. result isNil ifTrue: [ ^ self ]. result ifTrue: [ pane saveContents ] ifFalse: [ pane revertToSaved ]. className := Prompter prompt: 'Name of class:' default: ''. (className isNil or: [className isEmpty]) ifTrue: [ ^ self ]. className := className asSymbol. class := Smalltalk at: className ifAbsent: [ ^ Menu message: 'Class "', className, '" not found in Smalltalk.' ]. "Here is the check." (class isKindOf: Class) ifFalse: [ ^ Menu message: '"', className, '" is no class.' ]. CursorManager execute change. supers := (Array with: class), class allSuperclasses. blanks := 0. 1 to: supers size do: [ :i | (originalClasses includes: (supers at: i)) ifTrue: [ blanks := i ] ]. blanks = 0 ifTrue: [ CursorManager normal change. ^ Menu message: 'Class "', className, '" not found in this browser.' ]. supers do: [ :cl | hiddenClasses remove: cl ifAbsent: [] ]. self update: originalClasses. selectedClass isNil ifTrue: [ self classHighlight: true. (pane menuBar menuAt: 'Methods') enable ]. selectedClass := ((String new: (blanks - 1 max: 0)) atAllPut: $ ), class name. methodSelectedLast := false. self update. CursorManager normal change.! !