title: How to implement NSApplicationDelegate protocol in glfw application
body: <p>I am currently programming an application using glfw in MacOS X. My only problem is that the application doesn't use an AppDelegate, but does all the initialization in the main.cpp file like a command line utility. I specifically want to implement the function </p>
  
  <p><code>- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;</code> </p>
  
  <p>and I already registered the file extensions in the plist file and when I try to open them I get an error message saying "<strong>The document "Doc.xxx" could not be opened. MyApp cannot open files in the "xxx" format.</strong></p>
  
  <p>I attempted to create a singleton that sets itself as the delegate but it just doesn't call the function. Can anyone comment on the possibility of creating a class and implementing the NSApplicationDelegate functions?</p>