关于变化的类事件,pharo
是否可以监听类在更改时引发的事件?我需要知道系统浏览器中某些类的某些内容(代码、变量等)何时发生变化。
Is it possible to listen events that classes throw when changed? I need to know when something (code, variables, etc) changes in some classes from the system browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,从 Pharo 2.0 开始,现在有一个 SystemAnnouncer 可以发出公告。不再有 SystemChangeNotifier。
是访问它的方式。然后查看包系统公告
您可以使用注册
或
您可以使用取消订阅
Pay attention since Pharo 2.0, there is now a SystemAnnouncer that emits announcements. There is not SystemChangeNotifier anymore.
is the way to access it. Then look in the package System-Announcements
You can register using
or
You can unsubscribe using
SystemChangeNotifier uniqueInstance
是管理系统更改事件(代码和变量更改所属)的对象。查看对SystemChangeNotifier
的引用可以找到许多示例用户。例如,要收到有关所有更改的通知(可以使用其他注册方法,仅注册更改的子集):
从现在开始,使用 AbstractEvent 的子类实例调用方法
systemEvent:
代表所有更改。要摆脱进一步的通知,请执行:
SystemChangeNotifier uniqueInstance
is the object managing the system change events (to which code and variable changes belong). Have a look at the references toSystemChangeNotifier
to find many example users.For example, to be notified about all changes (other registration methods are available that only register for a subset of changes):
The method
systemEvent:
is from now on called with instances of subclasses ofAbstractEvent
representing all changes.To get rid of the further notifications execute: