Thanks for the feedback from both lists, <br>&nbsp; To test the monitor doIt this trivial example:<br><br>| obj1 obj2 |<br><br>obj1 := VersionNumber fromString: &#39;30&#39;.<br>obj2 := VersionNumber fromString: &#39;31&#39;.<br>
obj1 when: #myEvent send: #printString to: obj2.<br>obj1 triggerEvent: #myEvent.<br>{ obj1 . obj2 } inspect<br><br>and start the event monitor. If you use code like that anytime, the monitor will show you in real-time the event table state. <br>
<br>Possible uses includes:<br><br>- As a tool for learning about weak dictionaries, used currently by the EventManager. An interesting exercise question with the above code is: when do you think the (Weak)MessageSend will be garbage collected? (try to answer first without spying possible answers :)<br>
<br>A) Closing the inspector will do it.<br>B) No, some GC thing will nil event symbols and then the weak messages will dissapear.<br>C) Anything doing #flushEvents.<br>D) Smalltalk garbageCollect.<br>E) Manually nil all the event symbols in each object&#39;s action map: <br>
<br>EventManager actionMaps associationsDo: [: assoc |<br>&nbsp;&nbsp;&nbsp; assoc value associationsDo: [: idAssoc | <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; idAssoc key = #getCompletionController<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [ idAssoc key: nil ]<br>&nbsp;&nbsp;&nbsp; &nbsp;] ]<br><br>F) A winner combination of the above<br>
G) None of the above.<br><br>- As a tool for observe an intensive use of SASE events, as we do in some complex UI applications using SmallFaces. <br>- As an example of a simple tool for real-time monitoring. If you want your own monitor, subclass EventMonitor, re-implement #start something like the following (an example for some morphic events) :<br>
<br>start<br>&nbsp;&nbsp;&nbsp; &quot; Start monitoring events &quot;<br>&nbsp;&nbsp;&nbsp; | userText |<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; userText := UIManager default request: &#39;Type a class in the Morph hierarchy&#39;.<br>&nbsp;&nbsp;&nbsp; userText isEmptyOrNil <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: [ self morphicClass: PasteUpMorph ]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [ ( Smalltalk hasClassNamed: userText asSymbol )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: [ self morphicClass: ( Smalltalk at: userText asSymbol ) ]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [ self error: &#39;Class not found &#39; , userText ] ].<br>
&nbsp;&nbsp;&nbsp; super start.<br><br>and #eventsReport according to sample your object graph. In this example:<br><br>eventsReport<br>&nbsp;&nbsp;&nbsp; &quot; Answer a String with the current status of events in my domain &quot;<br><br>&nbsp;&nbsp;&nbsp; | dict |<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; ^ String streamContents: [ : s | <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; counter := counter + 1.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; s nextPutAll: &#39;====== Samples : &#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print: counter; cr.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self morphicClass allSubInstancesDo: [: morph |<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ( dict := morph valueOfProperty: #actionMap ) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifNotNil: [ <br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s nextPutAll: &#39;Source : &#39;;<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print: morph; cr;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nextPutAll: &#39; ActionMap : &#39;; cr.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dict associationsDo: [: idAssoc | <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s nextPutAll: &#39;&nbsp; Event : &#39;;<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print:&nbsp; idAssoc key; cr;<br>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nextPutAll: &#39;&nbsp; Message : &#39;;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print: idAssoc value; cr ] ].<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s cr ] <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]<br><br>Cheers<br><br>Hernán<br><br><div class="gmail_quote">2008/12/13 Stéphane Ducasse <span dir="ltr">&lt;<a href="mailto:stephane.ducasse@inria.fr">stephane.ducasse@inria.fr</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">sounds interesting.<br>
What is the key behavior (psy unexpected dependencies?<br>
<div><div></div><div class="Wj3C7c"><br>
On Dec 13, 2008, at 6:40 AM, Hernán Morales Durand wrote:<br>
<br>
&gt; Bonjour chers amis,<br>
&gt; &nbsp; Just to let you know that I uploaded a simple real time events<br>
&gt; monitor to the SqueakSource repository, it could be useful for those<br>
&gt; who use the SASE protocol (#when:send:to: , #triggerEvent: and<br>
&gt; friends).<br>
&gt; Cheers.<br>
&gt;<br>
&gt; Hernán<br>
&gt;<br>
&gt; PD: Download from <a href="http://www.squeaksource.com/EventsMonitor.html" target="_blank">http://www.squeaksource.com/EventsMonitor.html</a><br>
</div></div><div><div></div><div class="Wj3C7c">&gt; _______________________________________________<br>
&gt; Pharo-project mailing list<br>
&gt; <a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
&gt; <a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
<br>
<br>
_______________________________________________<br>
Pharo-project mailing list<br>
<a href="mailto:Pharo-project@lists.gforge.inria.fr">Pharo-project@lists.gforge.inria.fr</a><br>
<a href="http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project" target="_blank">http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project</a><br>
</div></div></blockquote></div><br>