Created
February 16, 2011 16:02
-
-
Save krawaller/829615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ti.include("/struct/struct.js"); | |
S.app.mainWindow = S.ui.createApplicationWindow(); | |
S.app.mainWindow.open(); | |
S.app.mood = "RADIANT!"; | |
Ti.App.fireEvent("app:mood.update"); | |
setTimeout(function(){Ti.App.fireEvent("app:msg",{msg:"Welcome!"});},1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var S = { | |
os: function(arg){ | |
// utility function for branching logic depending on os | |
}, | |
app: { // application state variables | |
mood: "radiant" | |
}, | |
ui: { | |
styles: { | |
// various app-wide theme definitions | |
}, | |
createApplicationWindow: function(){ | |
// creates the main app window. Called from app.js, will in turn call the | |
// other view constructors and populate the window. Defined in | |
// applicationwindow.js | |
}, | |
createFooView: function(){ | |
// creates the red empty Foo view. Defined in fooview.js, used in | |
// createApplicationWindow. | |
}, | |
createBarView: function(){ | |
// creates the green Bar view containing mood info. Defined in | |
// barview.js, used in createApplicationWindow. | |
}, | |
createBazView: function(){ | |
// creates the blue Baz view where you can set mood. Defined | |
// in bazview.js, used in createApplicationWindow. | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myButton.addEventListener("click",function(){ | |
Ti.UI.currentTab.open(Ti.UI.createWindow({url:'somefile.js', importantdata: mydata })); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment