How am I supposed to use TextMorph? It pops a debugger on right-click
when doing a TextMorph new contents: 'Text'; openInWorld TextMorph(Object)>>doesNotUnderstand: #editView. Stephan |
On Sat, May 2, 2015 at 5:31 PM, Stephan Eggermont <[hidden email]> wrote: TextMorph new contents: 'Text'; openInWorld There is only one implementor of #editView which is TextMorphEditView, a subclass of TextMorph. But... TextMorphEditView new contents: 'Text'; openInWorld right-click gives... "MessageNotUnderstood: receiver of "model" is nil" in TextMorphEditView>>handleInteraction: in this code... self editor model: editView model. "For evaluateSelection, etc" where /editView/ ivar is nil. Only TextMorphEditView>>setEditView: stores into this, and this has only one sender: PluggableTextMorph>>configureTextMorph: Then I notice method "PluggableTextMorph class >> on: text: accept:", so creating the following with usual accessors with Transcript tracing in them... Object subclass: #MyData instanceVariableNames: 'text' classVariableNames: '' category: 'MyPlay' The following lets me edit and save... (PluggableTextMorph on: (MyData new text: 'hello') text: #text accept: #text:) openInWorld Though saving doesn't clear the yellow triangle and I don't yet know how to restrict it to one line without a scroll bar (if you needed that?) cheers -ben |
I think this is a bug, introduced early in the move from squeak to pharo. (It used to work in squeak).either it uses String/LabelMorphs for texts or it uses another TextEditorMorph), without any pluggableXXXMorph around it, I think we should fix this. 2015-05-02 12:44 GMT+02:00 Ben Coman <[hidden email]>:
We have PluggableTextFieldMorph, that is used in UITheme>>#newTextEntryIn: aThemedMorph for: aModel get: getSel set: setSel class: aClass getEnabled: enabledSel help: helpText
|
btw, can someone remind we of the semantics of "Pluggable" here, and what you gain over the unplugged classes? cheers -ben On Sat, May 2, 2015 at 9:19 PM, Nicolai Hess <[hidden email]> wrote:
|
In reply to this post by Nicolai Hess
On 02/05/15 15:19, Nicolai Hess wrote:
> I think this is a bug, introduced early in the move from squeak to pharo. > (It used to work in squeak). > Although we don't have any use of a "pure" TextMorph (I don't know of > any place/project, > either it uses String/LabelMorphs for texts or it uses another > TextEditorMorph), without any pluggableXXXMorph around it, I think we > should fix this. I have 23 references to TextMorph in a 40556 image. In writing about Morphic in MorphicDraw, I am looking for the simplest classes that work. That should help when translating later to Bloc. Stephan |
2015-05-02 20:17 GMT+02:00 Stephan Eggermont <[hidden email]>: On 02/05/15 15:19, Nicolai Hess wrote: I meant, we don't use TextMorphs alone, as a manipulateable morph. Every text editing happens through some pluggableXXX morph.
|
In reply to this post by Ben Coman
2015-05-02 17:27 GMT+02:00 Ben Coman <[hidden email]>:
MVC with pluggable controller ? You can plug in the model and define the controller behavrior by supplying the different setter/getter selectors.
|
Free forum by Nabble | Edit this page |