Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Dec 12, 2017 3:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cocoa - Bounce Dock Icon
PostPosted: Fri Oct 12, 2012 12:34 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
Here is some updated code to bounce the dock icon.. Tested in RealStudio 2012r1.1 on Mac OS X 10.6.8..

Sub DoRequestUserAttention()
const kCocoaLib = "Cocoa.framework"
const NSCriticalRequest = 0
const NSInformationalRequest = 10

Declare Function NSClassFromString Lib kCocoaLib (aClassName as CFStringRef) as Ptr
Declare Function sharedApplication Lib kCocoaLib selector "sharedApplication" (aClassID as Ptr) as Ptr
Declare Sub requestUserAttention Lib kCocoaLib selector "requestUserAttention:" (aClassID as Ptr, aNSRequestUserAttentionType as Integer)

requestUserAttention(sharedApplication(NSClassFromString("NSApplication")), NSCriticalRequest)
End Sub


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa - Bounce Dock Icon
PostPosted: Thu Apr 11, 2013 10:02 am 
Offline

Joined: Tue Sep 04, 2012 4:41 pm
Posts: 4
Just wanted to bump this up since it didn't have any replies and helped me out recently.

This piece of code works great. Just keep in mind when you are testing it, the icon will only bounce if the application is not currently active. It will stop when the app regains focus.

Thanks!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group