Ignore:
Timestamp:
Sep 5, 2006, 2:12:07 AM (16 years ago)
Author:
livings124
Message:

Use built-in ability for verifying notifications' objects and update message log a little less often.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BarButton.m

    r732 r844  
    4949       
    5050        [nc addObserver: self selector: @selector(setForActive:)
    51                     name: NSWindowDidBecomeKeyNotification object: nil];
     51                    name: NSWindowDidBecomeKeyNotification object: [self window]];
    5252       
    5353        [nc addObserver: self selector: @selector(setForInactive:)
    54                     name: NSWindowDidResignKeyNotification object: nil];
     54                    name: NSWindowDidResignKeyNotification object: [self window]];
    5555       
    5656        [nc addObserver: self selector: @selector(resetBounds:)
     
    253253- (void) setForActive: (NSNotification *) notification
    254254{
    255     if ([notification object] != [self window])
    256         return;
    257 
    258255    if ([self image] == fButtonSelectedDim)
    259256        [self setImage: fButtonSelected];
     
    267264- (void) setForInactive: (NSNotification *) notification
    268265{
    269     if ([notification object] != [self window])
    270         return;
    271 
    272266    [self setImage: [self image] == fButtonSelected ? fButtonSelectedDim : fButtonNormalDim];
    273267   
    274268    if (fTrackingTag)
     269    {
    275270        [self removeTrackingRect: fTrackingTag];
     271        fTrackingTag = 0;
     272    }
    276273}
    277274
Note: See TracChangeset for help on using the changeset viewer.