Changeset 132
- Timestamp:
- 04/04/03 08:23:08 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/NJRHotKeyField.m
r131 r132 69 69 #pragma mark interface updating 70 70 71 // XXX still problems with command-A the first time 71 - (void)showStatus:(NSString *)error; 72 { 73 [self setAttributedStringValue: 74 [[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"(%@)", error] 75 attributes: statusAttributes]]; 76 [NSObject cancelPreviousPerformRequestsWithTarget: self selector: @selector(clearStatus) object: nil]; 77 [self performSelector: @selector(clearStatus) withObject: nil afterDelay: 0.5]; 78 [[self currentEditor] setSelectedRange: zeroRange]; 79 } 72 80 73 81 - (void)previewKeyEquivalentAttributedString:(NSAttributedString *)equivString; … … 78 86 [[self currentEditor] setSelectedRange: zeroRange]; 79 87 [previewString release]; 80 }81 82 - (void)showStatus:(NSString *)error;83 {84 [self setAttributedStringValue:85 [[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"(%@)", error]86 attributes: statusAttributes]];87 [[self currentEditor] setSelectedRange: zeroRange];88 88 } 89 89 … … 101 101 [[self currentEditor] setSelectedRange: zeroRange]; 102 102 [equivString release]; 103 } 104 105 - (void)clearStatus; 106 { 107 if ([[[self attributedStringValue] attributesAtIndex: 0 effectiveRange: NULL] isEqualToDictionary: statusAttributes]) { 108 [self showKeyEquivalentAttributedStringFinalized: ([[NSApp currentEvent] modifierFlags] & capturedModifierMask) == 0]; 109 } 103 110 } 104 111
Note:
See TracChangeset
for help on using the changeset viewer.