Search code examples
eventsevent-handlingsmalltalksqueak

Event Handling in Smalltalk(squeak)


How can I create my own events in Smalltalk? I am basically looking for some software events that can be triggered when some particular event happens.


Solution

  • In classic Smalltalk (supported by Squeak as a direct derivative of the original XEROX Parc image), you have a basic publish/subscribe model. Look for "event" in the protocol browser for Object instances.

    In modern Smalltalk, you can use catch/throw user-defined events using the Exception class and its subclasses. See the class documentation for Exception for details.

    You can also select the Announcements framework, available in Squeaksource, as a more flexible version of the classic event framework.