Category: preDevCamp

preDevCamp: Intro To Developing for WebOS: Code 4

comments Comments Off
By admin, August 7, 2009
HelloAssistant.prototype.setup = function() {

// set the initial total and display it
 this.total=0;
 this.controller.get('count').update(this.total);

// a local object for button attributes
 this.buttonAttributes = {};

// a local object for button model
 this.buttonModel = {
 buttonLabel : 'TAP HERE',
 buttonClass : '',
 disabled : false
 };

// set up the button
 this.controller.setupWidget("MyButton", this.buttonAttributes, this.buttonModel);
// bind the button to its handler
 Mojo.Event.listen(this.controller.get('MyButton'), Mojo.Event.tap, this.handleButtonPress.bind(this));
}

preDevCamp: Intro To Developing for WebOS: Code 3

comments Comments Off
By admin, August 7, 2009
HelloAssistant.prototype.handleButtonPress = function(event){
// increment the total and update the display
 this.total++;
 this.controller.get('count').update(this.total);
}

preDevCamp: Intro To Developing for WebOS: Code 2

comments Comments Off
By admin, August 7, 2009
this.controller.pushScene('first');

preDevCamp: Intro to Developing for WebOS

By admin, August 7, 2009

Here are the commands for the presentation:

palm-generate -p "{title:'Hello Atlanta', id:org.predevcamp.atlanta.hello, version:'1.0.0'}" HelloAtlanta

palm-package HelloAtlanta

palm-install org.predevcamp.atlanta.hello_1.0.0_all.ipk

palm-generate -t new_scene -p "name:Hello" HelloAtlanta

Here are the code snippits for the presentation:

Code Snippit 1 (hello-scene.html)

Code Snippit 2 (stage-assistant.js)

Code Snippit 3 (hello-assistant.js)

Code Snippit 4 (hello-assistant.js)

preDevCamp: Intro To Developing for WebOS: Code 1

comments Comments Off
By admin, August 7, 2009
<div id="main">
 <div>Header</div>
 <div id="count">0</div>
 <div id="MyButton" name="MyButton1" x-mojo-element="Button"></div>
</div>

OfficeFolders theme by Themocracy