Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code presenter: fix subscription to interaction model changed #1567

Open
tinchodias opened this issue Jun 28, 2024 · 1 comment
Open

Code presenter: fix subscription to interaction model changed #1567

tinchodias opened this issue Jun 28, 2024 · 1 comment

Comments

@tinchodias
Copy link
Contributor

Code presenter breaks the general presenter-adapter spec2 pattern when it subscribes itself via whenInteractionModelChangedDo:. Normally, the Morphic adapter subscribe on their buildWidget.

SpCodePresenter >> registerEventsForStyling [
self whenInteractionModelChangedDo: [ :im |
self withAdapterDo: [ :anAdapter |
anAdapter interactionModel: im ] ]
]

@tinchodias
Copy link
Contributor Author

Same happens in other properties of text presenter with selection: there is whenSelectionChangedDo: available, but when adapter is informed in this way:

updateSelectionFromModel: aSelection

	self withAdapterDo: [ :anAdapter | 
		anAdapter setSelectionFromModel: aSelection ]

But also others: look at senders of withAdapterDo:. So I may be wrong with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant