home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / ClassBuilder / Source / NObject.m < prev    next >
Encoding:
Text File  |  1993-01-25  |  1014 b   |  42 lines

  1. #pragma .h #import <objc/Object.h> 
  2. #pragma .h #import <appkit/Application.h> 
  3. #import "NObject.h"
  4. #import <appkit/Panel.h>
  5. /**
  6.  ** NObjects are just like Objects, 
  7.  ** except that they do not kill off
  8.  ** the application when they receive
  9.  ** a message they can't understand.
  10.  ** Instead, they pop up an alert panel.
  11.  **/
  12.  
  13. @implementation NObject: Object
  14. {
  15. }
  16.  
  17. + doesNotRecognize: (SEL)aSelector ;
  18. { int rval ;
  19.   rval = NXRunAlertPanel("CB",
  20.      "Error\n%s doesNotRecognize: %s","Continue","Abort CB",NULL,
  21.      [self name], sel_getName(aSelector)) ;
  22.   if(rval == 1) // i.e. continue
  23.     return self ;
  24.   else // i.e. abort
  25.    [self error: "CB aborted by user\n"] ;
  26.   return self ;
  27. }
  28.  
  29. - doesNotRecognize: (SEL)aSelector ;
  30. { int rval ;
  31.   rval = NXRunAlertPanel("CB",
  32.      "Error\n%s doesNotRecognize: %s","Continue","Abort CB",NULL,
  33.      [self name], sel_getName(aSelector)) ;
  34.   if(rval == 1) // i.e. continue
  35.     return self ;
  36.   else // i.e. abort
  37.    [self error: "CB aborted by user\n"] ;
  38.   return self ;
  39. }
  40.  
  41.  
  42. @end