• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bouncing dock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bouncing dock


  • Subject: Re: bouncing dock
  • From: John Stiles <email@hidden>
  • Date: Sun, 30 Jul 2006 11:45:16 -0700

Jeez, man, check the docs before posting :)
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/NSApplication/requestUserAttention:

Those methods do exist and work.


Yvon Thoraval wrote:
hey all,

i've read an article (cocoa-java) on making the dock bouncing :

<http://www.onjava.com/pub/a/onjava/2005/08/10/swinghacks.html?page=1>

the author wrote (under Bounce the Mac OS X Dock Icon) :

The com.apple.cocoa.application package contains an NSApplication object that has lots of useful methods. In particular, you want the requestUserAttention() method, which will make the dock icon bounce.


import com.apple.cocoa.application.*; // ... public void bounceDock() { NSApplication app = NSApplication.sharedApplication(); int id = app.requestUserAttention( NSApplication.UserAttentionRequestCritical); } // ...

NSApplication has a static method to get the singleton that represents the application. You can then call the requestUserAttention() method with the constant NSApplication.UserAttentionRequestCritical to make the dock bounce continuously. You can use other constants for other behaviors. The return value can be passed to the cancelUserAttentionRequest() method to cancel the alert once the user has responded. Be sure to add the /System/Library/Java/ directory to your classpath when compiling, so that javac will find the Cocoa wrapper classes.


then i've tested that (in Cocoa-Ruby) :


def bounce_dock
app=OSX::NSApplication.sharedApplication
# p "app.class=#{app.class}" here i get the right class !!!
# p "OSX::NSApplication.UserAttentionRequestCritical=#{OSX::NSApplication.UserAttentionRequestCritical}"


# NSApplication#UserAttentionRequestCritical - methodSignature is nil
#id = app.requestUserAttention(OSX::NSApplication.UserAttentionRequestCritical)
#NSApplication#UserAttentionRequestCritical - methodSignature is nil
# id = app.requestUserAttention(OSX::NSApplication.UserAttentionRequestCritical)
end


and if i call onto AppKiDo NSApplication doesn't have such methods.

what are the correct methods and constants.

or, may be, i'm doing that wrongly ?

best

Yvon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >bouncing dock (From: Yvon Thoraval <email@hidden>)

  • Prev by Date: bouncing dock
  • Next by Date: Re: bouncing dock
  • Previous by thread: bouncing dock
  • Next by thread: Re: bouncing dock
  • Index(es):
    • Date
    • Thread