-
-
Save krawaller/1084092 to your computer and use it in GitHub Desktop.
how to do subwindow with nav using struct
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
/** | |
* Appcelerator Titanium Platform | |
* Copyright (c) 2009-2011 by Appcelerator, Inc. All Rights Reserved. | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
**/ | |
// Code is stripped-down version of Tweetanium, to expose new structure paradigm | |
(function(){ | |
S.ui.createFooWin = function(){ | |
var win = Ti.UI.createWindow({backgroundColor: "red",title:"foo"}); | |
win.add(Ti.UI.createLabel(S.combine({text: "See blogpost @ http://blog.krawaller.se"},$$.Label))); | |
var button = Titanium.UI.createButton({ | |
title: 'Hello', | |
height: '20px' | |
}); | |
button.addEventListener('click',function(e) | |
{ | |
subwin = S.ui.createsubwin(); | |
S.app.mainTabGroup.activeTab.open(subwin); | |
}); | |
win.add(button); | |
return win; | |
}; | |
S.ui.createsubwin = function(){ | |
var win = Ti.UI.createWindow({backgroundColor: "red",title:"test sub"}); | |
win.add(Ti.UI.createLabel(S.combine({text: "Subwin test."},$$.Label))); | |
return win; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, you have made my day (again) :D