TextMorph right-click?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

TextMorph right-click?

Stephan Eggermont-3
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


Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Ben Coman

On Sat, May 2, 2015 at 5:31 PM, Stephan Eggermont <[hidden email]> wrote:
TextMorph new contents: 'Text'; openInWorld

I don't know anything about this area, but thought it would be interesting to dig...

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
Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Nicolai Hess
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.

2015-05-02 12:44 GMT+02:00 Ben Coman <[hidden email]>:

On Sat, May 2, 2015 at 5:31 PM, Stephan Eggermont <[hidden email]> wrote:
TextMorph new contents: 'Text'; openInWorld

I don't know anything about this area, but thought it would be interesting to dig...

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?)

We have PluggableTextFieldMorph, that is used in
UITheme>>#newTextEntryIn: aThemedMorph for: aModel get: getSel set: setSel class: aClass getEnabled: enabledSel help: helpText
 

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Ben Coman
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:
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.

2015-05-02 12:44 GMT+02:00 Ben Coman <[hidden email]>:

On Sat, May 2, 2015 at 5:31 PM, Stephan Eggermont <[hidden email]> wrote:
TextMorph new contents: 'Text'; openInWorld

I don't know anything about this area, but thought it would be interesting to dig...

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?)

We have PluggableTextFieldMorph, that is used in
UITheme>>#newTextEntryIn: aThemedMorph for: aModel get: getSel set: setSel class: aClass getEnabled: enabledSel help: helpText
 

cheers -ben


Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Stephan Eggermont-3
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


Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Nicolai Hess


2015-05-02 20:17 GMT+02:00 Stephan Eggermont <[hidden email]>:
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.

I meant, we don't use TextMorphs alone, as a manipulateable morph. Every text editing
happens through some pluggableXXX morph.
 

In writing about Morphic in MorphicDraw, I am looking for the simplest classes that work. That should help when translating later to Bloc.

Stephan



Reply | Threaded
Open this post in threaded view
|

Re: TextMorph right-click?

Nicolai Hess
In reply to this post by Ben Coman


2015-05-02 17:27 GMT+02:00 Ben Coman <[hidden email]>:
btw, can someone remind we of the semantics of "Pluggable" here, and what you gain over the unplugged classes?
cheers -ben


MVC with pluggable controller ?
You can plug in the model and define the controller behavrior by supplying the
different setter/getter selectors.

 

On Sat, May 2, 2015 at 9:19 PM, Nicolai Hess <[hidden email]> 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.

2015-05-02 12:44 GMT+02:00 Ben Coman <[hidden email]>:

On Sat, May 2, 2015 at 5:31 PM, Stephan Eggermont <[hidden email]> wrote:
TextMorph new contents: 'Text'; openInWorld

I don't know anything about this area, but thought it would be interesting to dig...

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?)

We have PluggableTextFieldMorph, that is used in
UITheme>>#newTextEntryIn: aThemedMorph for: aModel get: getSel set: setSel class: aClass getEnabled: enabledSel help: helpText
 

cheers -ben