<div>Just one thought before I go to bed:</div><br><div>Take a look at the senders of <font style="font-family:monospace">ActionMap>>#flushEventSystem</font>.</div><br><br><div>HTH,</div><br><div>Gerald</div><br><div class="gmail_quote_attribution">On May 5 2022, at 10:07 pm, Luciano Notarfrancesco via Cuis-dev <cuis-dev@lists.cuis.st> wrote:</div><blockquote><div>You can avoid replacing the existing instances by iterating over the preferences you read from the file and setting their values on the existing prefeences.</div><div><br><div class="gmail_quote"><div class="gmail_attr"><div>On Fri, 6 May 2022 at 2:28 AM Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" title="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:</div></div><blockquote><div><div><div><font size="4">Hi,</font></div></div><br><div><font size="4">When saved then loaded, the preferences installed with event listener lost the event listener:</font></div><br><div><div><span style="color:rgb(151, 8, 45)"><font size="4"><font style="font-family:monospace">PreferenceNG initialize.</font></font></span></div><div><span style="color:rgb(151, 8, 45)"><font size="4"><font style="font-family:monospace">(PreferenceNG instanceAt: #guiElementsSize ) actionMap</font></font></span></div><div><span style="color:rgb(151, 8, 45)"><font size="4"><font style="font-family:monospace">==> an IdentityDictionary(#preferenceChanged->WeakMessageSend(#defaultFontSize: -> PreferenceNG) )</font></font></span></div></div><br><div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">PreferenceNG saveAllTo: '/tmp/pref' asFileEntry.</font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">PreferenceNG loadFrom: '/tmp/pref' asFileEntry.</font></span></font></div><br><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">(PreferenceNG instanceAt: #guiElementsSize ) actionMap  </font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">==> nil</font></span></font></div></div><br><div><font size="4">To save all the preference, I use a naive:</font></div><br><div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">PreferenceNG>>saveAllTo: aFileEntry</font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">" Save all the preferences to a file "</font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">    SmartRefStream dumpOnFile: aFileEntry object: ThePreferences</font></span></font></div></div><br><div><font size="4">To load, the counter part:</font></div><br><div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">PreferenceNG>>loadFrom: aFileEntry</font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">" Load all preferences from file, it replaces entirely the existing preferences "</font></span></font></div><div><font size="4"><span style="color:rgb(151, 8, 45)"><font style="font-family:monospace">    ThePreferences _ SmartRefStream restoreFromFile: aFileEntry</font></span></font></div></div><br><div><div>This is not surprise as the actionMap is stored in another object, the class ActiveModel.</div></div><br><div>I have some ideas to solve the problem but I am interested to read other ideas.</div><br><div>Thanks</div><br><div>Hilaire</div></div><div><div><br></div><br><code><pre style="background-color:rgba(0,0,0,0.05);padding:0.2em 1em"><font style="font-family:monospace">-- <br>GNU Dr. Geo<br></font><font style="font-family:monospace"><a href="http://drgeo.eu" title="http://drgeo.eu">http://drgeo.eu</a></font><font style="font-family:monospace"><a href="http://blog.drgeo.eu" title="http://blog.drgeo.eu">http://blog.drgeo.eu</a></font></pre></code></div><div>--</div><div>Cuis-dev mailing list</div><div><a href="mailto:Cuis-dev@lists.cuis.st" title="mailto:Cuis-dev@lists.cuis.st">Cuis-dev@lists.cuis.st</a></div><div><a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" title="https://lists.cuis.st/mailman/listinfo/cuis-dev">https://lists.cuis.st/mailman/listinfo/cuis-dev</a></div></blockquote></div></div><div>--</div><div>Cuis-dev mailing list</div><div>Cuis-dev@lists.cuis.st</div><div>https://lists.cuis.st/mailman/listinfo/cuis-dev</div></blockquote>