Hey guys,
I here met a weird problem when adding items to JavaFX sequence, the code is as below,
import javafx.scene.shape.*;
import javafx.scene.Group;
var seq = [Circle{}, Path{}, Rectangle{}, Ellipse{}];
var test1 = Group{};
var test2 = Group{};
function run(args : String[]) {
test1.content = seq;
test2.content = seq;
println("sizeof test1: {sizeof test1.content}");
println("sizeof test2: {sizeof test2.content}");
}
It seems to be simple: The sequence 'seq' contains 4 nodes. Now I wish to pass the items of seq to two groups test1 and test2 respectively. However the output result is really weird,
sizeof test1: 0
sizeof test2: 4
After assignment test1.content = seq, the size of test1 has been 4 already. However after test2.content.seq the group test1 has been cleared again.
How is this happening? Any comments?