<br><font size=2 face="sans-serif">Thank for your links. I'll try to dig
further into it.</font>
<br>
<br><font size=2 face="sans-serif">A first look into SwitchMorph raises
a first question in me:</font>
<br>
<br><font size=2 face="sans-serif">When you call addDependent: should'nt
be there a corresponding removeDependent: in the code?</font>
<br>
<br><font size=2 face="sans-serif">Maybe connection: should first call
removeDependent: for the old connection before setting a new connection?</font>
<br><font size=2 face="sans-serif">Further, then I delete a SwitchMorph
maybe &nbsp;it should also disconnect from its's connections?</font>
<br>
<br><font size=2 face="sans-serif">Like</font>
<br>
<br><font size=3><b>connection: anObject </b><br>
&quot;Set anObject to be the connection among two or more Switches. Make
the <br>
receiver a dependent of the argument, anObject.&quot;</font>
<br><font size=3>connection ifNotNil: [ connection removeDependent: self
]. &nbsp; &nbsp;&quot; THIS IS NEW&quot;<br>
connection _ anObject.<br>
connection addDependent: self </font>
<br>
<br><font size=3>Dietmar</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Edgar J. De Cleene&quot;
&lt;edgardec2001@yahoo.com.ar&gt;</b> </font>
<br><font size=1 face="sans-serif">Gesendet von: beginners-bounces@lists.squeakfoundation.org</font>
<p><font size=1 face="sans-serif">05.06.2007 13:37</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Bitte antworten an<br>
&quot;A friendly place to get answers to even the most basic questions
&nbsp; &nbsp; &nbsp; &nbsp;about Squeak.&quot; &lt;beginners@lists.squeakfoundation.org&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">An</font></div>
<td><font size=1 face="sans-serif">&quot;A friendly place to get answers
to even the most basic questions about &nbsp; &nbsp; &nbsp; &nbsp;Squeak.&quot;
&lt;beginners@lists.squeakfoundation.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Kopie</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Thema</font></div>
<td><font size=1 face="sans-serif">Re: Antwort: Re: [Newbies] closing/deleting
a morph and dependents</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2><br>
<br>
<br>
El 6/5/07 7:56 AM, &quot;Dietmar Schielke&quot; &lt;Dietmar.Schielke@data-experts.de&gt;<br>
escribió:<br>
<br>
&gt; Hi Edgar, <br>
&gt; <br>
&gt; thanks for your answer :-)<br>
&gt; I will have to describe it better.<br>
&gt; <br>
&gt; Yes my morph and its submorphs disappear correctly when I close/delete
it.<br>
&gt; <br>
&gt; My problem is, that the submorphs need to do some clean up (unregister
as<br>
&gt; dependents from the domain objects) &nbsp;when they disapear from
the world . I<br>
&gt; tried to overwrite delete in my submorphs, but delete was not called
on my<br>
&gt; submorphs when i closed/deleted my GUI.<br>
&gt; <br>
&gt; Here is a short sketch of my classes:<br>
&gt; <br>
&gt; I have a class Device (with attributes name, ip-Adress, port) which
holds<br>
&gt; subdevices (objects of class Subdevice with attributes like name,
description,<br>
&gt; state..) <br>
&gt; <br>
&gt; To view and edit Devices with their subdevices i made a DeviceMorph
(for<br>
&gt; viewing/editing the &quot;primitive&quot; attributes of Device) and
a SubdeviceMorph<br>
&gt; (for the SubDevices). Devicemorphs hold Subdevicemorphs as submorphs.<br>
&gt; Subdevicemorphs register themself as dependent on an Subdevice object
so they<br>
&gt; get infomed when the &nbsp;Subdevice changes it's state (just the
squeak standard<br>
&gt; change notification mechanics). This works fine. I can open several<br>
&gt; DeviceMorphs for the same Device and a change on the device or its
subdevices<br>
&gt; via one of the openDevice Morphs ist instantly displayed on all open<br>
&gt; DeviceMorphs for that device.<br>
&gt; <br>
&gt; When i close one of the DeviceMorphs observing my Device i need to
unregister<br>
&gt; its SubDeviceMorphs from the SubDivices they have observed, because
they are<br>
&gt; no longer visible and do not need the change notifications of their
SubDevice<br>
&gt; anymore and because the reference from my SubDevice to my (now unvisible)<br>
&gt; SubDeviceMorph prevents the SubDeviceMorph from being garbage collected.<br>
&gt; <br>
&gt; Btw. I copied this design from the morphic counter example on<br>
&gt; http://wiki.squeak.org/squeak/795. The difference between the counter
example<br>
&gt; an my problem is, that my domain objects live more independent of
the GUI.<br>
&gt; <br>
&gt; I have seen that morphs can have a model, but i have no idea how to
use it.<br>
&gt; <br>
&gt; Thanks again, <br>
&gt; <br>
&gt; Dietmar <br>
<br>
I understand better now.<br>
It's really a good start point for doing a tutorial.<br>
I don't have time as 3.10 monopolize all I get, try to find some student
for<br>
do it.<br>
<br>
In the time, I have my very old tutorial<br>
http://ar.geocities.com/edgardec2001/LogicCircus1.html<br>
see pict of finished project at:<br>
http://wiki.squeak.org/squeak/5991<br>
<br>
Is my bad use of &nbsp;Fabrik Dan idea &nbsp;for connecting and passing
actions<br>
between morphic objects.<br>
<br>
If think this could be useful , I have ready to load in any Squeak , could<br>
send or put somewhere.<br>
<br>
Edgar<br>
<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
Beginners@lists.squeakfoundation.org<br>
http://lists.squeakfoundation.org/mailman/listinfo/beginners<br>
<br>
</font></tt>
<br>