DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
A Smart Trash Can, Delet All Morphs Of Same Class
TrashCanMorph subclass: #SmartTrashCanMorph instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'SqueakRos' initialize "Initialize the receiver's graphics, name, and balloon-help" super initialize. self image: TrashPicOn; offImage: TrashPic; pressedImage: TrashPicOn. self setNameTo: 'SmartTrash'. self setBalloonText: 'Drag some morph here . Removes all morph of same class' acceptDroppingMorph: aMorph event: evt ActiveWorld submorphs copy do: [:each | (each class == aMorph class ) ifTrue: [each delete]].