home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / ExampleController.m < prev    next >
Encoding:
Text File  |  1996-08-23  |  1.1 KB  |  47 lines

  1. /*
  2.         Copyright (c) 1996, NeXT Software, Inc.
  3.         All rights reserved.
  4.  
  5.         You may freely copy, distribute and reuse the code in this example.
  6.         NeXT disclaims any warranty of any kind, expressed or implied,
  7.         as to its fitness for any particular use.
  8. */
  9. #import "ExampleController.h"
  10.  
  11. @implementation ExampleController
  12.  
  13. - (BOOL)alertOrLoadNibNamed:(NSString *)nibName owner:(id)owner
  14. {
  15.     if ([NSBundle loadNibNamed:nibName owner:owner])
  16.         return YES;
  17.     NSRunAlertPanel(@"AssociationExample", @"Unable to load interface file %@", @"OK", NULL, NULL, nibName);
  18.  
  19.     return NO;
  20. }
  21.  
  22. - (void)callPopUpDynamic:(id)sender
  23. {
  24.     if (!popupDynamicWindow)
  25.         [self alertOrLoadNibNamed:@"PopUpDynamic" owner:self];
  26.  
  27.     [popupDynamicWindow makeKeyAndOrderFront:self];
  28. }
  29.  
  30. - (void)callBrowser:(id)sender
  31. {
  32.     if (!browserWindow)
  33.         [self alertOrLoadNibNamed:@"Browser" owner:self];
  34.  
  35.     [browserWindow makeKeyAndOrderFront:self];
  36. }
  37.  
  38. - (void)callPickAMovie:(id)sender
  39. {
  40.     if (!pickAMovieWindow)
  41.         [self alertOrLoadNibNamed:@"PickAMovie" owner:self];
  42.  
  43.     [pickAMovieWindow makeKeyAndOrderFront:self];
  44. }
  45.  
  46. @end
  47.