Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Mac OS » Mac OS X port architecture
Re: best way to draw text/fonts on MacOS from C/C++ [message #33349 is a reply to message #33339] Wed, 27 July 2011 08:12 Go to previous messageGo to previous message
daveremba is currently offline  daveremba
Messages: 32
Registered: June 2011
Location: Los Angeles, CA, USA
Member
Here is the minimal app from the Xcode template
for a Cocoa MacOS application:
// this code creates a top level window, and draws whatever is in the nib file
// if there is no nib file, the app will draw nothing and no top window appears
// Xcode template puts this code into three files, but they can be merged into one .m file:

#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
    return NSApplicationMain(argc,  (const char **) argv);
}

@interface cocoa_test2AppDelegate : NSObject <NSApplicationDelegate> {
    NSWindow *window;
}
@property (assign) IBOutlet NSWindow *window;
@end

@implementation cocoa_test2AppDelegate
@synthesize window;
// The @synthesize directive automatically generates the setters and getters 
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
	// Insert code here to initialize your application 
}
@end

and this file must exist:
  cocoa_test2_bundle.app/Contents/Resources/English.lproj/MainMenu.nib


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TheIDE/max x11 binary by daveremba
Next Topic: fix TheIde [DOWNLOAD] build flag options in GccBuilder for OSX11 and Cocoa
Goto Forum:
  


Current Time: Thu May 09 14:47:53 CEST 2024

Total time taken to generate the page: 0.02504 seconds