When I try...
self whenBuiltDo: [ self halt. self window whenClosedDo: [ self
halt. self repository unsubscribe: self ] ].
none of the halts occur.
However I got what I needed with the following�
did you try to register in the initialize method ?
Because if you register once the application is already open, it may not work :)
----------
ComposableModel>>topWindowHolder
^ owner
ifNil: [ window ]
ifNotNil: [ :o | o topWindowHolder ].
----------
ComposableModel>>whenWindowClosed: aBlock
self topWindowHolder value
ifNotNil: [ :w | w whenClosedDo: aBlock ]
ifNil: [ self topWindowHolder whenChangedDo: [ :w | w
whenClosedDo: aBlock ] ].
----------
PhLTitledTreeModel>>repository: aRepository
self assert: self repository isNil description: 'Changing the
repository is not allowed because we would have to change the context
as well'.
repositoryHolder value: aRepository.
self repository whenChangedSend: #refresh to: self.
self whenWindowClosed: [ self repository unsubscribe: self.
self inform: 'Works for composed sub-items'. ] .
self refresh
----------
PharoLauncher>>initialize
super initialize.
self whenWindowClosed: [ self inform: 'Works for top level
owner' ].
----------
And optionally you could now have...
ComposableModel>>window
^ self topWindowHolder value
�����
topWindowHolder sounds a bit hackish :)
I think this can be achieved with the whenBuiltDo:, I should investigate :)