Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we bounce the dock icon on the Mac?

Tags:

macos

cocoa

How can we bounce the dock icon of our application?

like image 940
Amit Battan Avatar asked Jan 08 '10 10:01

Amit Battan


People also ask

What is bounce icon on Dock?

This means that particular application needs you—click on the jumping icon and that application will “come forward.” Then you will probably see a message on the screen that needs to be taken care of, such as “Do you want to save this document” or “This application couldn't do what you wanted.” Just do what it wants you ...


2 Answers

You can use the requestUserAttention: from NSApplication. The NSRequestUserAttentionType allows you to specify whether the Dock icon will bounce once or until the application is activated.

like image 101
Laurent Etiemble Avatar answered Nov 15 '22 16:11

Laurent Etiemble


sorry it works... my focus was on my application when I test it... Its works when my focus is not on application

[NSApp requestUserAttention:NSCriticalRequest];

Is any way to bounce the icon even focus on application...

like image 45
Amit Battan Avatar answered Nov 15 '22 16:11

Amit Battan