TideSDK bring window to top level on click of system notification

veer7

I am using tideSDK to create desktop app.

I wanted to show the system notifications on certain events. The below code works well.

    //Create a callback function for the notification
var doSomething = function() {
    //Do something!
}

//Creating a notification and displaying it.
var notification = Ti.Notification.createNotification({
    'title' : 'Notification from App',
    'message' : 'Click here for updates!',
    'timeout' : 10,
    'callback' : doSomething,
    'icon' : 'app://images/notificationIcon.png'        
});

notification.show();

this from http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Notification

Here in doSomething method I want to bring the tideSDK app window to top level.

I tried Ti.UI.currentWindow.focus();

veer7

setTopMost together with show can be used to achieve this

var window = Ti.UI.currentWindow;
window.setTopMost(true);
window.show()
window.setTopMost(false);

It is important to do setTopMost(false), otherwise the window will always show on top of other windows even if you want to open other windows

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a draggable (borderless and titleless) top level window in QT

From Dev

TideSDK keep window set on top (transparent overlay)

From Dev

How to open window system menu on right click?

From Dev

Popup window unable to receive focus when top level window is minimized

From Dev

Scroll window to top of div on click

From Dev

Top-level window size

From Dev

Tkinter grid manager can't manage 'top level window' menu

From Dev

Determine url of top level window from a multilevel cross domain iframe

From Dev

Tkinter. How to destroy the root window while top level window is waiting for a variable

From Dev

Bring Access Window On Top When Opened From Excel

From Dev

How to bring a Windows Form on top?

From Dev

What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

From Dev

Bring JFrame window to the front

From Dev

Top level window in WinForms

From Dev

Bring carousel caption on top of the overlay

From Dev

C# Finding top-level window

From Dev

On click, bring element to the top of the window (with offset)

From Dev

Top-level window size

From Dev

Firebreath NPAPI plugin rendering video to top level browser window (HWND)

From Dev

Bring single item to top of list

From Dev

Tkinter grid manager can't manage 'top level window' menu

From Dev

Change the title for the default top level window

From Dev

How to find a window in X Window System on Linux and bring it to front?

From Dev

Bring Fragment to top of stack

From Dev

How to bring a Windows Form on top?

From Dev

What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

From Dev

How to bring top a specific textbox

From Dev

Determine if GTK window in xlib is a subwindow or a top level window

From Dev

Javascript: Call top-level window function from inside object

Related Related

  1. 1

    How to create a draggable (borderless and titleless) top level window in QT

  2. 2

    TideSDK keep window set on top (transparent overlay)

  3. 3

    How to open window system menu on right click?

  4. 4

    Popup window unable to receive focus when top level window is minimized

  5. 5

    Scroll window to top of div on click

  6. 6

    Top-level window size

  7. 7

    Tkinter grid manager can't manage 'top level window' menu

  8. 8

    Determine url of top level window from a multilevel cross domain iframe

  9. 9

    Tkinter. How to destroy the root window while top level window is waiting for a variable

  10. 10

    Bring Access Window On Top When Opened From Excel

  11. 11

    How to bring a Windows Form on top?

  12. 12

    What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

  13. 13

    Bring JFrame window to the front

  14. 14

    Top level window in WinForms

  15. 15

    Bring carousel caption on top of the overlay

  16. 16

    C# Finding top-level window

  17. 17

    On click, bring element to the top of the window (with offset)

  18. 18

    Top-level window size

  19. 19

    Firebreath NPAPI plugin rendering video to top level browser window (HWND)

  20. 20

    Bring single item to top of list

  21. 21

    Tkinter grid manager can't manage 'top level window' menu

  22. 22

    Change the title for the default top level window

  23. 23

    How to find a window in X Window System on Linux and bring it to front?

  24. 24

    Bring Fragment to top of stack

  25. 25

    How to bring a Windows Form on top?

  26. 26

    What are the differences among Top Level Window, Child window, Dialog(modal) window and non-dialog (modeless) windows?

  27. 27

    How to bring top a specific textbox

  28. 28

    Determine if GTK window in xlib is a subwindow or a top level window

  29. 29

    Javascript: Call top-level window function from inside object

HotTag

Archive