Minor Cocoa fixes

release
slava 2006-03-11 02:51:35 +00:00
parent b890b2ebeb
commit 21167c19a7
2 changed files with 26 additions and 6 deletions

View File

@ -0,0 +1,25 @@
IN: cocoa-opengl
USING: alien cocoa compiler io kernel math objc objc-NSObject
objc-NSOpenGLView objc-NSWindow parser sequences threads ;
{
{ "drawRect:" "void" { "int" "int" "int" "int" } [ drop ] }
} { }
"NSOpenGLView" "FactorView" define-objc-class
"FactorView" import-objc-class
: <NSOpenGLView>
NSOpenGLView [alloc]
0 0 100 100 <NSRect> NSOpenGLView [defaultPixelFormat]
[initWithFrame:pixelFormat:] ;
"OpenGL demo" 10 10 600 600 <NSRect> <NSWindow>
dup
<NSOpenGLView>
[setContentView:]
dup f [makeKeyAndOrderFront:]
event-loop

View File

@ -1,11 +1,6 @@
! Copyright (C) 2006 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
! This example requires Mac OS X. It has only been tested on
! 10.4. It must be run from a Factor runtime linked against the
! Cocoa library; you can obtain one with the 'macosx-sdl' target
! in the Makefile.
IN: cocoa-speech
USING: cocoa kernel objc-NSObject objc-NSSpeechSynthesizer ;
@ -13,4 +8,4 @@ USING: cocoa kernel objc-NSObject objc-NSSpeechSynthesizer ;
NSSpeechSynthesizer [alloc] f [initWithVoice:]
swap <NSString> [startSpeakingString:] ;
"Hello from Factor" say
"Hello from Factor" say drop