org.symbian.tools.wrttools.doc.WebDeveloper/html/GUID-0FCBC574-2328-4986-99D3-7DC4BDE9C3A4.html
equal
deleted
inserted
replaced
|
1 |
|
2 <!DOCTYPE html |
|
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
4 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="concept"/><meta name="DC.Title" content="STEW: loading the widget at startup"/><meta name="abstract" content="This section describes how to load a widget at startup."/><meta name="description" content="This section describes how to load a widget at startup."/><meta name="DC.Relation" scheme="URI" content="GUID-B12990B6-979C-4BBA-B030-FB7CEC04CB3A"/><meta name="DC.Relation" scheme="URI" content="GUID-5906D140-663D-4EE2-B0C1-4FECA5759384"/><meta name="DC.Relation" scheme="URI" content="GUID-775005BC-2FF8-45A9-BBA6-6CED6B5780A2"/><meta name="DC.Relation" scheme="URI" content="GUID-EB2043BB-E557-429B-BA0A-E350A6D06597"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-0FCBC574-2328-4986-99D3-7DC4BDE9C3A4"/><meta name="DC.Language" content="en"/><title>STEW: loading the widget at startup </title><script type="text/javascript"> |
|
5 function initPage() {} |
|
6 </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-0FCBC574-2328-4986-99D3-7DC4BDE9C3A4">STEW: loading the widget at startup</h1><div><p>This section describes how to load a widget at startup.</p> |
|
7 <p>The <code>init</code> function in the <code>main.js</code> file loads the widget. The function is triggered by the <code>init</code> event of the widget body element. The following code illustrates how to assign a function to the <code>onload</code> event handler, <code><body onload="javascript:init();"></code>:</p> |
|
8 <pre class="codeblock"><body onload="javascript:init();"> |
|
9 |
|
10 function init() { |
|
11 // Disable cursor mode. |
|
12 widget.setNavigationEnabled( false ); |
|
13 |
|
14 // Create the views. |
|
15 widgetMenu = new Menu(); |
|
16 loginScreen = new LoginScreen(); |
|
17 updateScreen = new UpdateScreen(); |
|
18 searchScreen = new SearchScreen(); |
|
19 settingsScreen = new SettingsScreen(); |
|
20 |
|
21 // Show first view. |
|
22 widgetMenu.activate( Menu.LOGIN_SCREEN ); |
|
23 } |
|
24 </pre> |
|
25 <p>The above code creates all the widget views and activates the <span class="uicontrol">Login</span> view screen by calling the <code>activate</code> function assigned to the menu option.</p> |
|
26 </div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html> |