• 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
bouncing dock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bouncing dock


  • Subject: bouncing dock
  • From: Yvon Thoraval <email@hidden>
  • Date: Sun, 30 Jul 2006 20:35:14 +0200

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


  • Follow-Ups:
    • found was (Re: bouncing dock)
      • From: Yvon Thoraval <email@hidden>
    • Re: bouncing dock
      • From: Shawn Erickson <email@hidden>
    • Re: bouncing dock
      • From: John Stiles <email@hidden>
  • Prev by Date: Re: Strange malloc/free issue inside a category
  • Next by Date: Re: bouncing dock
  • Previous by thread: Re: Strange malloc/free issue inside a category
  • Next by thread: Re: bouncing dock
  • Index(es):
    • Date
    • Thread