Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving stuff around, updating things
- Loading branch information
1 parent
90f693f
commit 6331b3f
Showing
6 changed files
with
61 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class Meow | ||
# addObserver can only be used with subclasses of NSObject, so we use this | ||
# one. | ||
class Notifier < OSX::NSObject | ||
def setup | ||
@callbacks = {} | ||
end | ||
|
||
def add(prc) | ||
pos = prc.object_id | ||
@callbacks[pos] = prc | ||
return pos | ||
end | ||
|
||
def clicked(notification) | ||
idx = notification.userInfo[GROWL_KEY_CLICKED_CONTEXT].to_i | ||
begin | ||
if block = @callbacks[idx] | ||
block.call | ||
end | ||
ensure | ||
@callbacks.delete idx | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters