Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
Introduced a slight delay between Growl notifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
eczarny committed Oct 29, 2011
1 parent d76f776 commit b0321ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 4 additions & 9 deletions nu/growl.nu
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@
((ZeroKitUtilities imageFromResource: "Draco"
inBundle: (ZeroKitUtilities applicationBundle)) TIFFRepresentation))

(- (void) growlIsReady is (puts "Growl: ready"))

(- (void) growlNotificationWasClicked: (id) clickContext is
(set gameURL (NSURL URLWithString: "http://www.dragongoserver.net/game.php?gid=#{clickContext}"))
((NSWorkspace sharedWorkspace) openURL: gameURL))

(- (void) growlNotificationTimedOut: (id) clickContext is
(puts "Growl: notification '#{clickContext}' timed out.")))
((NSWorkspace sharedWorkspace) openURL: gameURL)))

(GrowlApplicationBridge setGrowlDelegate: (set $growlDelegate ((DracoGrowlDelegate alloc) init)))

(function growl (message clickContext)
(GrowlApplicationBridge notifyWithTitle: "Draco"
description: (message stringValue)
(function growl (title message clickContext)
(GrowlApplicationBridge notifyWithTitle: title
description: message
notificationName: "Draco"
iconData: nil
priority: 0
Expand Down
3 changes: 2 additions & 1 deletion nu/main.nu
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
(item setTag: kPendingMoveTag)
(@statusMenu insertItem: item atIndex: insertionIndex)
(set insertionIndex (+ insertionIndex 1))
(growl "Your move with #{(head (tail game))}" (head game))))
(NSThread sleepForTimeInterval: 1)
(growl "Move pending" "Your move with #{(head (tail game))}" (head game))))
(else
(set item ((NSMenuItem alloc) initWithTitle: "No Pending Moves" action: nil keyEquivalent: ""))
(item setTag: kPendingMoveTag)
Expand Down

0 comments on commit b0321ae

Please sign in to comment.