Communication between the home screen and WRT

Communication between the home screen and WRT happens at the system level, and is therefore automatic. When WRT receives this communication, it fires events. The widget must respond to these events by calling a "decide" function that determines in which view (home screen or full screen) to display the widget. For instructions on implementing and calling this function, see Determining whether to display home screen or full screen.

User action System level Widget must
Sends the home screen to the foreground by turning the device on, selecting home screen from the open applications list, exiting full screen widget, and so forth.
  • Starts JavaScript timers for all widgets added to the home screen.

  • Sends onshow() and onresize() events for all widgets added to the home screens.

Call a "decide" function in reponse to onshow() and onresize(). For information, see Determining whether to display home screen or full screen.
Adds a widget to the home screen
  • Launches the widget in the background.

  • Fires onload() and onshow() events.

  • May prompt user for permissions.

  • Sends a bitmap update of the widget data to the home screen.

Call a "decide" function in response to onload() and onshow(). For information, see Determining whether to display home screen or full screen.
Removes widget from the home screen Shuts the widget down. None needed.
Sends the home screen to the background by selecting another application from the open applications list, opening a home screen widget in full view, and so forth.
  • Suspends timers.

  • Suspends bitmap updates of the widget.

  • Fires an onhide() event.

None needed.
Opens the home screen widget in full screen view
  • Suspends all other home screen widgets.

  • Starts the JavaScript timers for the selected widget.

  • Fires onshow() and onresize() events for the selected widget.

Call a "decide" function in response to onload() and onresize(). For information, see Determining whether to display home screen or full screen.