http://www.newton-inc.com/dev/techinfo/qa/qa.htm
RegUnionSoup
?newtSoup
called MakeSoup
which you can override. The MakeSoup
method is responsible for calling RegUnionSoup
(or otherwise making a soup) and then calling the FillNewSoup
method if the soup is new/empty. MakeSoup
is called normally as part of initializing the newtSoup
object. Here is a sample MakeSoup
method that will use a newly defined slot (from the newtSoup
based template) for the user name.MakeSoup
method. In particular, MakeSoup
is used by the newtSoup
implementation to initialize the object, so it needs to set up other internal slots. It's vital that the 'appSymbol
slot in the message context be set to the passed argument, and that the 'theSoup
slot be set to the soup or unionSoup that MakeSoup
creates or gets. (Recall that RegUnionSoup
returns the union soup, whether it previously existed or not.)GetSoupList
method of union soups used in this code snippet returns an array with the member soups. It should be considered documented and supported. A newly created union will have no members, so FillNewSoup
should be called. This is an improvement over the default MakeSoup
method, which always calls FillNewSoup
if the soup on the internal store is empty.'userName
slot, which is looked up in the current context. As with soupName
, soupDescr
, etc, you should set a new userName
slot in the frame in the allSoups
frame in the newtApplication
template. MakeSoup: func(appSymbol) begin self.appSymbol := appSymbol; // just do it... self.theSoup := RegUnionSoup(appSymbol, { name: soupName, userName: userName, ownerApp: appSymbol, userDescr: soupDescr, indexes: soupIndices, }); if Length(theSoup:GetSoupList()) = 0 then :FillNewSoup(); end;