|
<< Index >> |
FutureBasic |
BeginCDeclaration | statement | |
|
BeginCDeclaration
#include <OpenGL/glu.h>
EndC
// declarations of all kinds (these go in *.h)
BeginCDeclaration
void
FooBeep();
EndC
void FooBeep()
{
SysBeep( 1 );
}
42
,
// declarations of all kinds (these go in *.h)
BeginCDeclaration
extern const CFStringRef kFooVersionString;
EndC
// definitions of functions and global vars (these go in *.c)
BeginCFunction
const CFStringRef kFooVersionString = CFSTR( "1.3" );
EndC
system CFStringRef kFooVersionString // declare symbol for the translator
@"1.3" or fn CFSTR ("1.3" )
, with exactly the same effect.
// declarations of all kinds (these go in *.h)
BeginCDeclaration
@interface FooThing : NSObject {
NSWindow *window;
}
- (void)buildWindow;
@end
void BuildWindow( void );
EndC
// definitions of functions and global vars (these go in *.m)
BeginCFunction
@implementation FooThing
- (void)buildWindow {
window = [[NSWindow alloc] initWithContentRect:NSMakeRect( 0, 0, 300, 300 )
styleMask:NSTitledWindowMask
backing:NSBackingStoreBuffered defer:NO];
[window center];
[window setTitle:@"FooThing"];
[window makeKeyAndOrderFront:nil];
}
@end
void BuildWindow( void )
{
FooThing *ft = [[FooThing alloc] init];
[ft buildWindow];
[ft release];
}
EndC
// declare symbol for the translator
toolbox BuildWindow
BuildWindow
HandleEvents
See also
BeginCCode; BeginCFunction; EndC