Container

Container

The Container widget acts as a container of widgets. Users can insert any kind of widgets into a container and the container becomes their parent.

The 'widget' property of the JS object, that is this.widget in the source code, is the only Container widget available.

Any newly created widget (e.g. Canvas, MouseArea and etc.) must be inserted into the container widget so that it can be visible and be interacted with, that is, receive events.

Constructor

new Container()

Initializes a new instance of Container

Example
var mouseArea = new MouseArea();
var canvas = new Canvas();
this.widget.add(mouseArea);
this.widget.add(canvas);

Extends

Members

height :Number

Overrides:

This property holds the height of the widget.

Type:
  • Number

opacity :Number

Overrides:

This property holds the opacity of the widget. The valid range of opacity is from 1.0 (completely opaque) to 0.0 (completely transparent).

Type:
  • Number

rotation :Number

Overrides:

This property holds the rotation of the widget in degrees clockwise.

Type:
  • Number

width :Number

Overrides:

This property holds the width of the widget.

Type:
  • Number

x :Number

Overrides:

This property holds the x coordinate of the widget relative to its parent.

Type:
  • Number

y :Number

Overrides:

This property holds the y coordinate of the widget relative to its parent.

Type:
  • Number

Methods

add(widget) → {Boolean}

Insert the widget into the container. Note that this function also changes the position and size of the widget to fill the container.

Example
var canvas = new Canvas();
this.widget.add(canvas);
Parameters:
Name Type Description
widget Widget

The widget to be inserted.

Returns:

A boolean value indicating the result of the insertion operation.

Type
Boolean