Forum Navigation
You need to log in to create posts and topics.

Nibless Tutorials

Posted by: fbcocoa.bw <fbcocoa.bw@...>

Brian wrote:

> Pluses for using nibless:
> (1) FB compatible because FB doesn’t work with Cocoa nibs

Below is Steve's Tutorial_2 using Cocoa nib (attached).
'---------------
compile as "Objective-C"

include resources "main.xib"

BeginCDeclaration
@interface MyWindowController : NSWindowController
{
IBOutlet NSWindow *window;
}
- (IBAction)beep:(id)sender;
@end //interface
EndC

BeginCFunction
@implementation MyWindowController
- (IBAction)beep:(id)sender {
NSBeep();
}
@end //implementation
EndC

BeginCCode
{
MyWindowController *controller = [[MyWindowController alloc] initWithWindowNibName:@"main"];
[controller.window makeKeyAndOrderFront:nil];
[NSApp run];
}
EndC
'---------------

If the nib doesn't make it through the server, I'll stuff it in FBCocoa's files area.

Bernie