Making Samples executable. #!/usr/bin/env io and chmod a+x *.io
[io/jrb1.git] / addons / ObjcBridge / samples / BridgeTest / main.io
blob738c4011549fb4e11fb18b1b3ab7896877649336
1 #!/usr/bin/env io
3 ObjcBridge autoLookupClassNamesOn
4 ObjcBridge debugOn
6 IoConverter := Object clone
7 IoConverter setInput: := method(v, self input := v)
8 IoConverter setOutput: := method(v, self output := v)
9 IoConverter convert: := method(sender,
10 output setIntValue:(input intValue * 2)
13 ObjcBridge newClassWithNameAndProto("Converter", IoConverter)
16 FooBar := Object clone
17 FooBar setConverter: := method(v, self converter := v)
18 FooBar setText: := method(v, self text := v)
19 FooBar doSomething: := method(sender,
20 text setString:("Hello World!")
23 ObjcBridge newClassWithNameAndProto("Foobar", FooBar)
26 ObjcObject := Object clone
27 ObjcObject init := method(name,
28 obj := Object clone
29 ObjcBridge newClassWithNameAndProto(name, obj)
30 return obj