When notebook presenter is built (with Morphic) with no pages, and the pages are added afterwards, whenSelectedPageChangedDo: is never triggerer on tab changes by mouse click.
The only difference between the two snippets is that ntb buildWithLayout: ntb defaultLayout. is on different line.
The problem is probably in SpMorphicNotebookAdapter>>#addModelTo: where it skips the setup if there are no pages at the time, not expecting that some can be added dynamically.
If needed, there is a visual example - run the code and switch tabs using mouse clicks:
When notebook presenter is built (with Morphic) with no pages, and the pages are added afterwards,
whenSelectedPageChangedDo:
is never triggerer on tab changes by mouse click.Possible test:
It works if there is at least one page before the notebook presenter is built the first time, like this:
The only difference between the two snippets is that
ntb buildWithLayout: ntb defaultLayout.
is on different line.The problem is probably in
SpMorphicNotebookAdapter>>#addModelTo:
where it skips the setup if there are no pages at the time, not expecting that some can be added dynamically.If needed, there is a visual example - run the code and switch tabs using mouse clicks:
and the one that works, because pages are added beforehand: