Rubric events

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

Rubric events

Miguel Campusano
Hello,
I'm working on modifying the styling of text by using RubTextSegmentMorph. The problem is that the text could be modified dynamically by selecting another text, so the styling must be modified.
I want to use the announcements system of Rubric but something weird happens. When I subscribe to the announce RubTextUpdatedInModel of the RubScrolledTextMorph, the styling sometimes works, sometimes doesn't.
What I noticed in the method RubScrolledTextMorph>>whenTextUpdatedInModel:
the announcement is done before setting the text in the morph and if I change this to make the announcement after setting the text, everything works fine.

So my question is:
Is there something special to announcer the set of the text before actually setting it? Is it ok to change it? 
OR
Is another way to do what I want to do?

Bests,
Miguel
Reply | Threaded
Open this post in threaded view
|

Re: Rubric events

Pharo Smalltalk Users mailing list
Hello Miguel,
Did you tried to subscribe to RubTextUpdatedInModel through the model of the morph (and not directly the morph) ?
Cheers
Alain


> On 30 Sep 2015, at 16:52, Miguel Campusano <[hidden email]> wrote:
>
> Hello,
> I'm working on modifying the styling of text by using RubTextSegmentMorph. The problem is that the text could be modified dynamically by selecting another text, so the styling must be modified.
> I want to use the announcements system of Rubric but something weird happens. When I subscribe to the announce RubTextUpdatedInModel of the RubScrolledTextMorph, the styling sometimes works, sometimes doesn't.
> What I noticed in the method RubScrolledTextMorph>>whenTextUpdatedInModel:
> the announcement is done before setting the text in the morph and if I change this to make the announcement after setting the text, everything works fine.
>
> So my question is:
> Is there something special to announcer the set of the text before actually setting it? Is it ok to change it?
> OR
> Is another way to do what I want to do?
>
> Bests,
> Miguel


Reply | Threaded
Open this post in threaded view
|

Re: Rubric events

Marcus Denker-4
This mails arrived here empty.

> On 02 Oct 2015, at 08:36, Alain Plantec via Pharo-users <[hidden email]> wrote:
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Rubric events

Peter Uhnak
On Fri, Oct 2, 2015 at 8:54 AM, Marcus Denker <[hidden email]> wrote:
This mails arrived here empty.

Interesting. Gmail says for that mail "{no text body}", but if I click on it I see the content:

-----------------------------------

From: Alain Plantec <[hidden email]>
To: Any question about pharo is welcome <[hidden email]>
Cc: 
Date: Fri, 2 Oct 2015 08:36:27 +0200
Subject: Re: [Pharo-users] Rubric events
Hello Miguel,
Did you tried to subscribe to RubTextUpdatedInModel through the model of the morph (and not directly the morph) ?
Cheers
Alain

Reply | Threaded
Open this post in threaded view
|

Re: Rubric events

Miguel Campusano
In reply to this post by Pharo Smalltalk Users mailing list
Yes, I tried. 
For what I see is the that the text of the morph still have not been setter when this announcement is triggered

On Fri, Oct 2, 2015 at 8:36 AM Alain Plantec via Pharo-users <[hidden email]> wrote:
Hello Miguel,
Did you tried to subscribe to RubTextUpdatedInModel through the model of the morph (and not directly the morph) ?
Cheers
Alain


> On 30 Sep 2015, at 16:52, Miguel Campusano <[hidden email]> wrote:
>
> Hello,
> I'm working on modifying the styling of text by using RubTextSegmentMorph. The problem is that the text could be modified dynamically by selecting another text, so the styling must be modified.
> I want to use the announcements system of Rubric but something weird happens. When I subscribe to the announce RubTextUpdatedInModel of the RubScrolledTextMorph, the styling sometimes works, sometimes doesn't.
> What I noticed in the method RubScrolledTextMorph>>whenTextUpdatedInModel:
> the announcement is done before setting the text in the morph and if I change this to make the announcement after setting the text, everything works fine.
>
> So my question is:
> Is there something special to announcer the set of the text before actually setting it? Is it ok to change it?
> OR
> Is another way to do what I want to do?
>
> Bests,
> Miguel