Roassal: having changes in shapes

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

Roassal: having changes in shapes

jfabry
Hola,

for my visualization, I want to be able to change the color of a shape after the view has been opened, depending on a given condition. So I wrote something like below, where the instvar lastview holds the view that was opened.

highlightNode: aName
        |node|
        node := lastview elementFromModel: aName.
        node isNil ifFalse: [
                node shape color: (Color red).
                lastview signalUpdate.]

Sadly, I do not see the shape changing color to red. What can I do to have this working?

Thanks in advance,

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: having changes in shapes

PabloEstefo
Hi Johan,

On Apr 23, 2014, at 15:48, Johan Fabry <[hidden email]> wrote:

Hola,

for my visualization, I want to be able to change the color of a shape after the view has been opened, depending on a given condition. So I wrote something like below, where the instvar lastview holds the view that was opened.

highlightNode: aName
|node|
node := lastview elementFromModel: aName.
node isNil ifFalse: [
node shape color: (Color red).
lastview signalUpdate.]

Sadly, I do not see the shape changing color to red. What can I do to have this working?

You could try by doing:

highlightNode: aName
|node|
node := lastview elementFromModel: aName.
node isNil ifFalse: [
node shape color: (Color red).
node update].


Here’s a small example:

|node lastview|
lastview := RTView new.
lastview addAll: (RTBox elementsOn: #(1 2 3 4)).
node := lastview elementFromModel: 3.
node isNil ifFalse: [
node shape color: (Color red).
node update.].
RTHorizontalLineLayout on: lastview elements.
lastview open. 

Does it help you?

Cheers,
Pablo


Thanks in advance,

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal: having changes in shapes

jfabry

Thanks, Pablo! It works like a charm, even other changes, e.g. with edges,  work :-)
I had to add a lastview signalUpdate because the diagram was not redrawing until I clicked on it. (The window did not have focus).

On Apr 23, 2014, at 4:13 PM, Pablo Estefó <[hidden email]> wrote:

> highlightNode: aName
> |node|
> node := lastview elementFromModel: aName.
> node isNil ifFalse: [
> node shape color: (Color red).
> node update].
>
>
> Here’s a small example:
>
> |node lastview|
> lastview := RTView new.
> lastview addAll: (RTBox elementsOn: #(1 2 3 4)).
> node := lastview elementFromModel: 3.
> node isNil ifFalse: [
> node shape color: (Color red).
> node update.].
> RTHorizontalLineLayout on: lastview elements.
> lastview open.
>
> Does it help you?
>
> Cheers,
> Pablo



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev