On 04/09/2011 22:26, Stéphane Ducasse wrote:
Alain
it means that we should define shoutAboutToStyle: to certain places like inspector pane. Isn't? :)
arrggh, I've tried and it exhibits a problem. see the end of the answer. yes, you can do it with a shoutAboutToStyle: something like: Inspector>>shoutAboutToStyle: aPluggableTextMorph ^ (aPluggableTextMorph getTextSelector = #contents) not because an inspector is made of two text views. The one for the contents should not be styled. Only the one for coding should. But this solution is not so good because the model is making an asumptions about the view. It considers that the argument responds to #getTextSelector and that #contents can be the value of the result. Another solution should be to directly set the text editors as not styled when the view is built. Regarding Inspector view, it is built by MorphicUIManager>>openInspector: asMorphOn: withLabel: Normally, sending #styled: to a PluggableTextMorph with true as argument set it as styled. I prefer this solution because of the separation of concern between the model and its view(s). But now that the default is "not styled", this solution is broken. Maybe we should re-introduce a 'styled' inst var and revise the #okToStyle implementation. I open an issue. Alain