Added -reopenWith:.
authorJens Alfke <jens@mooseyard.com>
Fri Apr 18 09:25:10 2008 -0700 (2008-04-18)
changeset 62d492d8c2053
parent 5 c9f2e0c7359a
child 7 59addced5e2a
Added -reopenWith:.
UniqueWindowController.h
UniqueWindowController.m
     1.1 --- a/UniqueWindowController.h	Tue Apr 15 18:02:40 2008 -0700
     1.2 +++ b/UniqueWindowController.h	Fri Apr 18 09:25:10 2008 -0700
     1.3 @@ -16,6 +16,8 @@
     1.4  
     1.5  + (BOOL) isModel: (id)model1 equalToModel: (id)model2;
     1.6  
     1.7 +- (void) reopenWith: (id)model;
     1.8 +
     1.9  @end
    1.10  
    1.11  
     2.1 --- a/UniqueWindowController.m	Tue Apr 15 18:02:40 2008 -0700
     2.2 +++ b/UniqueWindowController.m	Fri Apr 18 09:25:10 2008 -0700
     2.3 @@ -36,12 +36,20 @@
     2.4      if( ! w ) {
     2.5          w = [[self alloc] initWith: model];
     2.6          [w showWindow: self];
     2.7 +    } else {
     2.8 +        if( model != w.model )
     2.9 +            [w reopenWith: model];
    2.10      }
    2.11      [w.window makeKeyAndOrderFront: self];
    2.12      return w;
    2.13  }
    2.14  
    2.15  
    2.16 +- (void) reopenWith: (id)model
    2.17 +{
    2.18 +}
    2.19 +
    2.20 +
    2.21  - (void) windowWillClose: (NSNotification*)n
    2.22  {
    2.23      [self autorelease];