Nibless Tutorials
Quote from Forum Archives on September 5, 2011, 5:23 pmPosted by: fbcocoa.bw <fbcocoa.bw@...>
Brian wrote:> Pluses for using nibless:
> (1) FB compatible because FB doesn’t work with Cocoa nibsBelow 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
EndCBeginCFunction
@implementation MyWindowController
- (IBAction)beep:(id)sender {
NSBeep();
}
@end //implementation
EndCBeginCCode
{
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
Posted by: fbcocoa.bw <fbcocoa.bw@...>
> 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