Skip to content

Instantly share code, notes, and snippets.

@ryugoo
Created November 8, 2012 15:57
Show Gist options
  • Save ryugoo/4039687 to your computer and use it in GitHub Desktop.
Save ryugoo/4039687 to your computer and use it in GitHub Desktop.
マルチコンテキストでウィンドウを開く
do ->
# Main window
win = Ti.UI.createWindow
url: "win1.js"
# Tab
tab = Ti.UI.createTab
title: "Apps"
icon: "KS_nav_ui.png"
window: win
tabGroup = Ti.UI.createTabGroup()
tabGroup.addTab tab
tabGroup.open()
return
# Current window
win = Ti.UI.currentWindow
win.backgroundColor = "#FFFFFF"
win.title = "Window 1"
# Label
label = Ti.UI.createLabel
text: "Click here (Open Window 2)."
label.addEventListener "click", ->
Ti.UI.currentTab.open Ti.UI.createWindow
url: "win2.js"
win.add label
# Current window
win = Ti.UI.currentWindow
win.backgroundColor = "#DDDDDD"
win.title = "Window 2"
# Label
label = Ti.UI.createLabel
text: "Click here (Open Window 3)."
label.addEventListener "click", ->
Ti.UI.currentTab.open Ti.UI.createWindow
url: "win3.js"
win.add label
# Current window
win = Ti.UI.currentWindow
win.backgroundColor = "#BBBBBB"
win.title = "Window 3"
# Label
label = Ti.UI.createLabel
text: "Click here (Open Window 1)."
label.addEventListener "click", ->
Ti.UI.currentTab.open Ti.UI.createWindow
url: "win1.js"
win.add label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment