API Reference

Core application components

Component

Description

App

The top-level representation of an application.

DocumentApp

An application that manages documents.

Window

An operating system-managed container of widgets.

MainWindow

The main window of the application.

General widgets

Component

Description

ActivityIndicator

A small animated indicator showing activity on a task of indeterminate length, usually rendered as a “spinner” animation.

Button

A button that can be pressed or clicked.

Canvas

A drawing area for 2D vector graphics.

DateInput

A widget to select a calendar date

DetailedList

An ordered list of content where each item has an icon, a main heading, and a line of supplementary text.

Divider

A separator used to visually distinguish two sections of content in a layout.

ImageView

Image Viewer

Label

A text label for annotating forms or interfaces.

MapView

A zoomable map that can be annotated with location pins.

MultilineTextInput

A scrollable panel that allows for the display and editing of multiple lines of text.

NumberInput

A text input that is limited to numeric input.

PasswordInput

A widget to allow the entry of a password. Any value typed by the user will be obscured, allowing the user to see the number of characters they have typed, but not the actual characters.

ProgressBar

A horizontal bar to visualize task progress. The task being monitored can be of known or indeterminate length.

Selection

A widget to select an single option from a list of alternatives.

Slider

A widget for selecting a value within a range. The range is shown as a horizontal line, and the selected value is shown as a draggable marker.

Switch

A clickable button with two stable states: True (on, checked); and False (off, unchecked). The button has a text label.

Table

A widget for displaying columns of tabular data.

TextInput

A widget for the display and editing of a single line of text.

TimeInput

A widget to select a clock time

Tree

A widget for displaying a hierarchical tree of tabular data.

WebView

An embedded web browser.

Widget

The abstract base class of all widgets. This class should not be be instantiated directly.

Layout widgets

Usage

Description

Box

A generic container for other widgets. Used to construct layouts.

ScrollContainer

A container that can display a layout larger that the area of the container, with overflow controlled by scroll bars.

SplitContainer

A container that divides an area into two panels with a movable border.

OptionContainer

A container that can display multiple labeled tabs of content.

Resources

Component

Description

App Paths

A mechanism for obtaining platform-appropriate file system locations for an application.

Command

A representation of app functionality that the user can invoke from menus or toolbars.

Font

Fonts

Icon

An icon for buttons, menus, etc

Image

An image

Source

A base class for data source implementations.

ListSource

A data source describing an ordered list of data.

TreeSource

A data source describing an ordered hierarchical tree of data.

ValueSource

A data source describing a single value.

Validators

A mechanism for validating that input meets a given set of criteria.

Hardware

Usage

Description

Camera

A sensor that can capture photos and/or video.

Location

A sensor that can capture the geographical location of the device.

Screen

A representation of a screen attached to a device.

Other

Component

Description

Constants

Symbolic constants used by various APIs.

Keys

Symbolic representation of keys used for keyboard shortcuts.

Types

Utility data structures used by Toga APIs.