The Page Object

Page object is a different choice of containers to add and arrange GUI components on your GUI. Page object looks similar to ordinary html page, but It differs from it in usage and behavior.
Use page component when you need a style other than window box to your UI.

Create Page Container
var pgTest = new TPage("Test");
pgTest.add(new TText("Hello World!"));
showPage(pgTest);

In this example, we created a page container with 'Test' title and added a text component to it.

Use showPage method to show the page.

Close Page Container
var onCloseClick = function() {
hidePage();
};

var pgTest = new TPage("Test", "#e5eecc", 20, 20);
var btnClose = new TButton("Close");
btnClose.setOnClick(onCloseClick);
pgTest.add(new TText("Hello World!"));
pgTest.add(btnClose);
showPage(pgTest);

In this example, we added a close button to close and hide the page container. The hidePage method will close the latest opened page container.

Page object constructor may take several optional parameters:

var pgTest = new TPage(title, backColor, margin, padding, layout);

By default page container takes vertical layout. You may set a horizontal layout instead by passing a layout object to the constructor.

Page Container Methods
Method Description
Add Adds an object to page
Refresh Resize page object with its contents based on view port dimensions
setBackground sets page background color or image
setTitle sets page title