Hi Johan,

On Apr 23, 2014, at 15:48, Johan Fabry <jfabry@dcc.uchile.cl> 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
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev