Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
5,402 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
// | ||
// Application.h | ||
// DockBadge | ||
// | ||
// Created by Nando Vieira on 8/8/09. | ||
// Copyright 2009 Simples Ideias. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface Application : NSObject { | ||
NSDockTile *dock; | ||
IBOutlet NSButton *button; | ||
} | ||
|
||
-(IBAction)toggleBadgeLabel:(id)sender; | ||
- (void)bounceDockIcon:(NSTimer *)timer; | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Application.m | ||
// DockBadge | ||
// | ||
// Created by Nando Vieira on 8/8/09. | ||
// Copyright 2009 Simples Ideias. All rights reserved. | ||
// | ||
|
||
#import "Application.h" | ||
|
||
|
||
@implementation Application | ||
- (void)awakeFromNib | ||
{ | ||
dock = [[NSApplication sharedApplication] dockTile]; | ||
[self toggleBadgeLabel:nil]; | ||
|
||
// to test icon bouncing, "build and go" and focus another app | ||
[NSTimer scheduledTimerWithTimeInterval:5.0 | ||
target:self | ||
selector:@selector(bounceDockIcon:) | ||
userInfo:nil | ||
repeats:NO]; | ||
} | ||
|
||
- (void)bounceDockIcon:(NSTimer *)timer | ||
{ | ||
[NSApp requestUserAttention:NSCriticalRequest]; | ||
} | ||
|
||
-(IBAction)toggleBadgeLabel:(id)sender | ||
{ | ||
if (![dock badgeLabel] || [[dock badgeLabel] isEqualToString:@""]) { | ||
[dock setBadgeLabel:@"10"]; | ||
[NSApp requestUserAttention:NSCriticalRequest]; | ||
} else { | ||
[dock setBadgeLabel:@""]; | ||
} | ||
} | ||
|
||
- (void)dealloc | ||
{ | ||
[dock release]; | ||
[super dealloc]; | ||
} | ||
@end |
Binary file not shown.
Oops, something went wrong.