Newbie: Titanium.UI.currentWindow OR My First Minutes With Titanium
hi all,
just downloaded titanium and tried to compile the kitchensink examples, which unfortunately do not compile (stops at [INFO] Detected custom font: comic_zine_ot.otf and that's it).
i then created a new project, compiled it and it worked (the basic tab1/tab2 one), so i doesn't seem to be an install problem, but a kitchensink problem.
i tried to copy single examples to my "helloworld.app" by simply copy+paste from the kitchensink examples to my helloworld app.js, but most examples use
var win = Titanium.UI.currentWindow;
which seems to be a view or window created by the kitchensink "main example" and so it causes a "Result of expression 'win' [null] is not an object. at app.js"
well since it's my first 5minutes with titanium i wondering how to create that basic view or window?
i tried the location.js or the rss.js (yeah, i also copied the included/needed files), but both example refer to "currentWindow" which does not seem to exist.
thanks: lars
1 Answer
-
Accepted Answer
If you want to create a window, you use:
var win = Titanium.UI.createWindow();
currentWindow is a definition for the current window. It's pretty much just a shortcut so you can define things in the current window or use it for events and not write "Titanium.UI.currentWindow" everytime (Instead you use "win").