
#import "AppDelegate.h"
#import "RZBundle.h"
#import "InfoManager.h"

@implementation AppDelegate

- appDidInit:sender
{
   /* 
    * tell the RZBundle class to register bundles (in "standard" directories
    * as well as the app-wrapper) and install class lookup handler.
    */
   [RZBundle setup];

   return self;
}
   
- showInfoPanel:sender
{
   if(!infoManager) {
      /* Use RZBundle to find and load the InfoPanel Bundle */
      infoManager = [[[RZBundle classNamed:"InfoManager"] alloc] init];
      
      /* we could have used these other methods of getting an InfoManager instance: */
      // infoManager = [[objc_getClass("InfoManager") alloc] init];
      // infoManager = [[@(InfoManager) alloc] init];
      
      /* and, if we've installed the headers via make-install on our bundle: */
      // infoManager = [[_InfoManager alloc] init];
   }
   
   if(!infoManager) {
      NXRunAlertPanel("Error","Can't locate InfoManager class", NULL, NULL, NULL);
   } else {
      [infoManager showPanel:nil];
   }
   
   return self;
}

@end
