views:

117

answers:

0

When changing the content of an HBox in a Tile, the Tile elements gets sorted as if it has only two columns. For example, running the following script and clicking the button would display the objects tiled in 2 columns, instead of four:

var grid = AnimGrid {
    columns: 4
    content: for (i in [1..10])
    HBox{content:[Text {content:i.toString()}]}
}

Stage {
    title: "Application title"
    width: 250
    height: 80
    scene: Scene {
        content: [
            grid,
            Button {
                text:"click"
                action:function() {
                    var d = (grid.content[3] as HBox);
                    insert Rectangle{width:30 height:10} into d.content;
                }
                layoutX:180    
            }
        ]
        }
}

Anyone knows a workaround? (The bug report at kenai offers a workaround by recreating the Tile, but this is not always feasible)