'From Squeak3.7alpha of ''11 September 2003'' [latest update: #5623] on 4 January 2004 at 7:39:40 pm'! "Change Set: ArchiveViewerFix-di Date: 4 January 2004 Author: Dan Ingalls md: just reposting as a normal changeset. Subject: [BUG] [FIX] ArchiveViewer-createButtonBar is fragile Author: Dan Ingalls Date Posted: 11 December 2003 Comments: The current method for ArchiveViewer-createButtonBar uses StrikeFont allInstances to find a narrow font. It then assumes that the one it found is accessible through the normally registered textstyles. If your image contains a local font --held in , eg, a class variable -- then this method will fail if it chooses that font, since it cannot be accessed through the normal registry. The attached fix enumerates registered fonts rather than using allInstances. It should be included wherever ArchiveViewer is maintained, as well as with Scamper, since its installation calls this method (that's where I got bitten)."! !ArchiveViewer methodsFor: 'initialization' stamp: 'di 12/10/2003 10:17'! createButtonBar | bar button narrowFont registeredFonts | registeredFonts _ OrderedCollection new. TextStyle knownTextStyles do: [:st | (TextStyle named: st) fonts do: [:f | registeredFonts addLast: f]]. narrowFont := registeredFonts detectMin: [:ea | ea widthOfString: 'Contents' from: 1 to: 8]. bar := AlignmentMorph newRow. bar color: self backgroundColor; rubberBandCells: false; vResizing: #shrinkWrap; cellInset: 6 @ 0. #(#('New\Archive' #canCreateNewArchive #createNewArchive 'Create a new, empty archive and discard this one') #('Load\Archive' #canOpenNewArchive #openNewArchive 'Open another archive and discard this one') #('Save\Archive As' #canSaveArchive #saveArchive 'Save this archive under a new name') #('Extract\All' #canExtractAll #extractAll 'Extract all this archive''s members into a directory') #('Add\File' #canAddMember #addMember 'Add a file to this archive') #('Add from\Clipboard' #canAddMember #addMemberFromClipboard 'Add the contents of the clipboard as a new file') #('Add\Directory' #canAddMember #addDirectory 'Add the entire contents of a directory, with all of its subdirectories') #('Extract\Member As' #canExtractMember #extractMember 'Extract the selected member to a file') #('Delete\Member' #canDeleteMember #deleteMember 'Remove the selected member from this archive') #('Rename\Member' #canRenameMember #renameMember 'Rename the selected member') #('View All\Contents' #canViewAllContents #changeViewAllContents 'Toggle the view of all the selected member''s contents')) do: [:arr | | buttonLabel | buttonLabel := (TextMorph new) string: arr first withCRs fontName: narrowFont familyName size: narrowFont pointSize wrap: false; hResizing: #shrinkWrap; lock; yourself. (button := PluggableButtonMorph on: self getState: arr second action: arr third) vResizing: #shrinkWrap; hResizing: #spaceFill; onColor: self buttonOnColor offColor: self buttonOffColor; label: buttonLabel; setBalloonText: arr fourth. bar addMorphBack: button. buttonLabel composeToBounds]. ^bar! !