<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 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>
"Set anObject to be the connection among two or more Switches. Make
the <br>
receiver a dependent of the argument, anObject."</font>
<br><font size=3>connection ifNotNil: [ connection removeDependent: self
]. " THIS IS NEW"<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>"Edgar J. De Cleene"
<edgardec2001@yahoo.com.ar></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>
"A friendly place to get answers to even the most basic questions
about Squeak." <beginners@lists.squeakfoundation.org></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">"A friendly place to get answers
to even the most basic questions about Squeak."
<beginners@lists.squeakfoundation.org></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, "Dietmar Schielke" <Dietmar.Schielke@data-experts.de><br>
escribió:<br>
<br>
> Hi Edgar, <br>
> <br>
> thanks for your answer :-)<br>
> I will have to describe it better.<br>
> <br>
> Yes my morph and its submorphs disappear correctly when I close/delete
it.<br>
> <br>
> My problem is, that the submorphs need to do some clean up (unregister
as<br>
> dependents from the domain objects) when they disapear from
the world . I<br>
> tried to overwrite delete in my submorphs, but delete was not called
on my<br>
> submorphs when i closed/deleted my GUI.<br>
> <br>
> Here is a short sketch of my classes:<br>
> <br>
> I have a class Device (with attributes name, ip-Adress, port) which
holds<br>
> subdevices (objects of class Subdevice with attributes like name,
description,<br>
> state..) <br>
> <br>
> To view and edit Devices with their subdevices i made a DeviceMorph
(for<br>
> viewing/editing the "primitive" attributes of Device) and
a SubdeviceMorph<br>
> (for the SubDevices). Devicemorphs hold Subdevicemorphs as submorphs.<br>
> Subdevicemorphs register themself as dependent on an Subdevice object
so they<br>
> get infomed when the Subdevice changes it's state (just the
squeak standard<br>
> change notification mechanics). This works fine. I can open several<br>
> DeviceMorphs for the same Device and a change on the device or its
subdevices<br>
> via one of the openDevice Morphs ist instantly displayed on all open<br>
> DeviceMorphs for that device.<br>
> <br>
> When i close one of the DeviceMorphs observing my Device i need to
unregister<br>
> its SubDeviceMorphs from the SubDivices they have observed, because
they are<br>
> no longer visible and do not need the change notifications of their
SubDevice<br>
> anymore and because the reference from my SubDevice to my (now unvisible)<br>
> SubDeviceMorph prevents the SubDeviceMorph from being garbage collected.<br>
> <br>
> Btw. I copied this design from the morphic counter example on<br>
> http://wiki.squeak.org/squeak/795. The difference between the counter
example<br>
> an my problem is, that my domain objects live more independent of
the GUI.<br>
> <br>
> I have seen that morphs can have a model, but i have no idea how to
use it.<br>
> <br>
> Thanks again, <br>
> <br>
> 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 Fabrik Dan idea 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>