Color doesn't work

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

Color doesn't work

Natalia Tymchuk
Hello,
using #buildEdgesFromObjects:, I want to get red edges

http://ws.stfx.eu/DVAZQNX7QQOK

but, I'm getting the edges with grey color.
If it’s bug, can someone fix it please; if not - what am I doing wrong?

Kind regards,
Natalia

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

Re: Color doesn't work

abergel
Hi Natalia,

The method buildEdgesFromObjects: is deprecated. This is not your fault, it was not indicated. I have renamed the method category that contains it.

Instead, you should use RTEdgeBuilder. Here is an example:
-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.

lb := RTEdgeBuilder new.
lb view: v.
lb objects: col. 
lb moveBehind.
lb shape line color: Color red.
lb connectFrom: #yourself to: [ :num | num * 2 ].

v
-=-=-=-=-=-=-=-=-=-=

Regarding your script, it was nearly correct. You should not do “edge shape color: Color red”, instead you should use trachelShape, as in:

-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.
lines:=RTEdge 
buildEdgesFromObjects: col 
from: #yourself
to: [ :num | num * 2 ]
inView: v.
lines do: [ :edge | edge trachelShape color: Color red ]. 
v
-=-=-=-=-=-=-=-=-=-=
I know, this is not really intuitive. 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Apr 21, 2015, at 4:44 PM, Natalia Tymchuk <[hidden email]> wrote:

Hello,
using #buildEdgesFromObjects:, I want to get red edges

http://ws.stfx.eu/DVAZQNX7QQOK

but, I'm getting the edges with grey color.
<Screen Shot 2015-04-21 at 21.37.41.png>
If it’s bug, can someone fix it please; if not - what am I doing wrong?

Kind regards,
Natalia


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

Re: Color doesn't work

Nicolai Hess
In reply to this post by Natalia Tymchuk
The call
lines do: ....
happens after the line shapes are already constructed (with the default color).

This should work:

col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.
lines:=RTEdge
    buildEdgesFromObjects: col
    from: #yourself
    to: [ :num | num * 2 ]
    using:(RTLine color:Color red)
    inView: v .




2015-04-21 21:44 GMT+02:00 Natalia Tymchuk <[hidden email]>:
Hello,
using #buildEdgesFromObjects:, I want to get red edges

http://ws.stfx.eu/DVAZQNX7QQOK

but, I'm getting the edges with grey color.
If it’s bug, can someone fix it please; if not - what am I doing wrong?

Kind regards,
Natalia

_______________________________________________
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: Color doesn't work

Natalia Tymchuk
In reply to this post by abergel
Thanks, Alex.

Best regards,
Natalia

On 21 Apr 2015, at 22:21, Alexandre Bergel <[hidden email]> wrote:

Hi Natalia,

The method buildEdgesFromObjects: is deprecated. This is not your fault, it was not indicated. I have renamed the method category that contains it.

Instead, you should use RTEdgeBuilder. Here is an example:
-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.

lb := RTEdgeBuilder new.
lb view: v.
lb objects: col. 
lb moveBehind.
lb shape line color: Color red.
lb connectFrom: #yourself to: [ :num | num * 2 ].

v
-=-=-=-=-=-=-=-=-=-=

Regarding your script, it was nearly correct. You should not do “edge shape color: Color red”, instead you should use trachelShape, as in:

-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.
lines:=RTEdge 
buildEdgesFromObjects: col 
from: #yourself
to: [ :num | num * 2 ]
inView: v.
lines do: [ :edge | edge trachelShape color: Color red ]. 
v
-=-=-=-=-=-=-=-=-=-=
I know, this is not really intuitive. 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Apr 21, 2015, at 4:44 PM, Natalia Tymchuk <[hidden email]> wrote:

Hello,
using #buildEdgesFromObjects:, I want to get red edges

http://ws.stfx.eu/DVAZQNX7QQOK

but, I'm getting the edges with grey color.
<Screen Shot 2015-04-21 at 21.37.41.png>
If it’s bug, can someone fix it please; if not - what am I doing wrong?

Kind regards,
Natalia



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

Re: Color doesn't work

stepharo
In reply to this post by abergel
alex

why do you use deprecate:

Le 21/4/15 23:21, Alexandre Bergel a écrit :
Hi Natalia,

The method buildEdgesFromObjects: is deprecated. This is not your fault, it was not indicated. I have renamed the method category that contains it.

Instead, you should use RTEdgeBuilder. Here is an example:
-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.

lb := RTEdgeBuilder new.
lb view: v.
lb objects: col. 
lb moveBehind.
lb shape line color: Color red.
lb connectFrom: #yourself to: [ :num | num * 2 ].

v
-=-=-=-=-=-=-=-=-=-=

Regarding your script, it was nearly correct. You should not do “edge shape color: Color red”, instead you should use trachelShape, as in:

-=-=-=-=-=-=-=-=-=-=
col:= 1 to: 10.
v := RTView new.
el:= RTBox elementsOn: col.
v add: el.
RTGridLayout on: el.
lines:=RTEdge 
buildEdgesFromObjects: col 
from: #yourself
to: [ :num | num * 2 ]
inView: v.
lines do: [ :edge | edge trachelShape color: Color red ]. 
v
-=-=-=-=-=-=-=-=-=-=
I know, this is not really intuitive. 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Apr 21, 2015, at 4:44 PM, Natalia Tymchuk <[hidden email]> wrote:

Hello,
using #buildEdgesFromObjects:, I want to get red edges

http://ws.stfx.eu/DVAZQNX7QQOK

but, I'm getting the edges with grey color.
<Screen Shot 2015-04-21 at 21.37.41.png>
If it’s bug, can someone fix it please; if not - what am I doing wrong?

Kind regards,
Natalia



_______________________________________________
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