Line | |
---|
1 | // |
---|
2 | // PSAlarmNotifierController.m |
---|
3 | // Pester |
---|
4 | // |
---|
5 | // Created by Nicholas Riley on Tue Oct 08 2002. |
---|
6 | // Copyright (c) 2002 Nicholas Riley. All rights reserved. |
---|
7 | // |
---|
8 | |
---|
9 | #import "PSAlarmNotifierController.h" |
---|
10 | #import "PSAlarm.h" |
---|
11 | |
---|
12 | @implementation PSAlarmNotifierController |
---|
13 | |
---|
14 | // XXX should use NSNonactivatingPanelMask on 10.2 |
---|
15 | |
---|
16 | + (PSAlarmNotifierController *)controllerWithTimerExpiredNotification:(NSNotification *)notification; |
---|
17 | { |
---|
18 | return [[self alloc] initWithAlarm: [notification object]]; |
---|
19 | } |
---|
20 | |
---|
21 | - (id)initWithAlarm:(PSAlarm *)alarm; |
---|
22 | { |
---|
23 | if ([self initWithWindowNibName: @"Notifier"]) { |
---|
24 | [[self window] center]; |
---|
25 | [messageField setStringValue: [alarm message]]; |
---|
26 | [dateField setObjectValue: [alarm date]]; |
---|
27 | [NSApp requestUserAttention: NSInformationalRequest]; |
---|
28 | [NSApp activateIgnoringOtherApps: YES]; |
---|
29 | [[self window] makeKeyAndOrderFront: nil]; |
---|
30 | [[self window] orderFrontRegardless]; |
---|
31 | [NSApp cancelUserAttentionRequest: NSInformationalRequest]; |
---|
32 | NSBeep(); |
---|
33 | } |
---|
34 | return self; |
---|
35 | } |
---|
36 | |
---|
37 | - (IBAction)close:(id)sender; |
---|
38 | { |
---|
39 | [self close]; |
---|
40 | } |
---|
41 | |
---|
42 | @end |
---|
Note: See
TracBrowser
for help on using the repository browser.