]> gitweb.factorcode.org Git - factor.git/blob - basis/cocoa/application/application-docs.factor
a2c711c3ea199d83459680250869f1f0a1a8a0a5
[factor.git] / basis / cocoa / application / application-docs.factor
1 USING: debugger quotations help.markup help.syntax strings alien
2 core-foundation core-foundation.strings core-foundation.arrays ;
3 IN: cocoa.application
4
5 HELP: <NSString>
6 { $values { "str" string } { "alien" alien } }
7 { $description "Allocates an autoreleased " { $snippet "CFString" } "." } ;
8
9 { <NSString> <CFString> CF>string } related-words
10
11 HELP: with-autorelease-pool
12 { $values { "quot" quotation } }
13 { $description "Sets up a new " { $snippet "NSAutoreleasePool"  } ", calls the quotation and frees the pool." } ;
14
15 HELP: NSApp
16 { $values { "app" "an " { $snippet "NSApplication" } } }
17 { $description "Pushes the current " { $snippet "NSApplication" } " singleton." } ;
18
19 HELP: with-cocoa
20 { $values { "quot" quotation } }
21 { $description "Sets up an autorelease pool, initializes the " { $snippet "NSApplication" } " singleton, and calls the quotation." } ;
22
23 HELP: cocoa-app
24 { $values { "quot" quotation } }
25 { $description "Initializes Cocoa, calls the quotation, and starts the Cocoa event loop." } ;
26
27 HELP: add-observer
28 { $values { "observer" "an " { $snippet "NSObject" } } { "selector" string } { "name" "an " { $snippet "NSString" } } { "object" "an " { $snippet "NSObject" } } }
29 { $description "Registers an observer with the " { $snippet "NSNotificationCenter" } " singleton." } ;
30
31 HELP: remove-observer
32 { $values { "observer" "an " { $snippet "NSObject" } } }
33 { $description "Unregisters an observer from the " { $snippet "NSNotificationCenter" } " singleton." } ;
34
35 HELP: install-delegate
36 { $values { "receiver" "an " { $snippet "NSObject" } } { "delegate" "an Objective C class" } }
37 { $description "Sets the receiver's delegate to a new instance of the delegate class." } ;
38
39 HELP: objc-error
40 { $error-description "Thrown by the Objective C runtime when an error occurs, for example, sending a message to an object with an unrecognized selector." } ;
41
42 ARTICLE: "cocoa-application-utils" "Cocoa application utilities"
43 "Utilities:"
44 { $subsection NSApp }
45 { $subsection add-observer }
46 { $subsection remove-observer }
47 { $subsection install-delegate }
48 "Combinators:"
49 { $subsection cocoa-app }
50 { $subsection with-autorelease-pool }
51 { $subsection with-cocoa } ;
52
53 IN: cocoa.application
54 ABOUT: "cocoa-application-utils"