Java Reference
In-Depth Information
public var cols:Integer = 1
on replace {
if(postInitted and not inCalc) {
layout();
}
};
To do a layout on the Group's
content
instance variable, we need to add an
override declaration.
override var content
on replace oldValues [lo..hi] = newValues {
if(postInitted and not inCalc) {
layout();
}
}
The following is an example of how to create a
GridLayout
object literal with
some example nodes, using the default
CENTER
alignment. Listing 5.23 shows
how to use the
GridLayout
class.
Listing 5.23
Grid Layout - Object Literal
scene: Scene {
width: 200
height: 200
content:
GridLayout
{
cols
: 3
content
: [
Rectangle {
width: 50
height: 20
fill: Color.NAVY
stroke: Color.YELLOW
},
...
When we run this, we see the display as shown in Figure 5.12.
Figure 5.12
Custom Container for Grid Layout
Search WWH ::
Custom Search