Benjamin wrote:
Sure thing. That was part of my original intention. 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... ---------- 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 ---------- If those ComposableModel additions are okay, I'll submit a slice on Case 12677 (renamed to "ComposableModel subcomponents need to act on window close") https://pharo.fogbugz.com/f/cases/12677/ cheers -ben |
- [Pharo-dev] #windowIsClosing not sent to model of WindowModel btc
- Re: [Pharo-dev] #windowIsClosing not sent to model of Window... Benjamin
- Re: [Pharo-dev] #windowIsClosing not sent to model of Wi... btc
- Re: [Pharo-dev] #windowIsClosing not sent to model of Wi... btc
- Re: [Pharo-dev] #windowIsClosing not sent to model o... Benjamin
- Re: [Pharo-dev] #windowIsClosing not sent to mod... btc
