Search code examples
tidesdk

How to use events in TideSDK


I tried to use an event that is triggered when the current window is maximized, however I can't seem to get the event triggerd.

I tried the following:

var appWindow = Ti.UI.currentWindow();
appWindow.addEventListener('maximized', function(){
  alert('maximized...');
});

and:

Ti.UI.UserWindow.maximized(function() {
  alert('test2');
});

and:

Ti.UI.currentWindow.maximized( function() {
  alert('test');
});

Does anyone know how to use this event: http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.UI.UserWindow-event-maximized ?


Solution

  • The following should work:

    var appWindow = Ti.UI.getCurrentWindow();
    appWindow.addEventListener(Ti.MAXIMIZED, function(){
        alert('maximized');
    });