Skip to content

Instantly share code, notes, and snippets.

@sohang3112
Created June 29, 2022 04:46
Show Gist options
  • Save sohang3112/9e72d551ce407cbe4dcf0caf78737cbe to your computer and use it in GitHub Desktop.
Save sohang3112/9e72d551ce407cbe4dcf0caf78737cbe to your computer and use it in GitHub Desktop.
Delete from view all instances of a `Morph` class

Delete all open instances of class CircleMorph:

CircleMorph allInstances do: [ :circle | circle delete ]

Or, a slightly shorter way:

CircleMorph allInstancesDo: [ :circle | circle delete ]

Notes:

  • The objects will still exist in memory, but they will disappear from view.
  • Any subclass of Morph class will also work here (instead of CircleMorph).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment