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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.