Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Phone API Reference - UI Core - window - add

add

Description

Adds one or more widgets to the group.

Basic Example: 

Code Block
exampleObj.add(widget[, widget...]);

Parameters

Name

Required

Type

Default

Description

widget

Yes

widget

Widget to act on.

Examples

Using the 'add' method with a variety of widgets

Code Block
 // add a group to the window.
var group = new Group(0, 0, window.w, window.h);
window.add(group);
  
//add a title to the group
group.add(new Text(0, 0, winow.w, Text.LINE_HEIGHT));
//add a scroll to the group slightly smaller due to the text @ top and offset the same.
var scroll = new Scroll(0, Text.LINE_HEIGHT, window.w, (window.h - Text.LINE_HEIGHT));
group.add(list);
  
//add a set of images to the list.
var img1 = new Image("tmp", "test1.png", 30, 30, 50, 10);
var img2 = new Image("tmp", "test2.png", 30, 45, 50, 10)
var img3 = new Image("tmp", "test3.png", 30, 60, 50, 10)
scroll.add(img1, img2, img3); //support for adding multiple is the same with group and window.