|
zobjc egg: msg#00026lisp.scheme.chicken
I integrated Felix's objc egg into mine, and added classes, instance variables, and automatic memory management. The result is called "zobjc" to avoid clobbering the existing objc egg. I plan to write up an eggdoc shortly, but in the meantime I could not resist creating the first Cocoa application for Chicken. :) That code is included below, and also in the egg (cd tests/; make). Get zobjc at: http://jiyu.gnook.org/~zbigniew/eggs/zobjc.egg Oh, and it's a cold, snowy 19F here... or -7.222222222222222 C. ;;; ------------------------------------------ ;;; test f->c app ;;; Derived from the gauche-objc bridge test application. (use cocoa) ;; and compile with -X zobjc (objc:nsbeep) (print "Starting F->C application...") (define (f2c f) (/ (- f 32.0) 1.8)) (define (c2f c) (+ (* 1.8 c) 32)) (define-objc-class Controller NSObject ((ID far) (ID cel)) (- VOID awakeFromNib (let ((far @far) (cel @cel)) @[far setTitle: "Far"] @[cel setTitle: "Cel"] @[cel setFloatValue: 0.0] @[far setFloatValue: (c2f 0.0)])) (- VOID ((convertToCel: ID sender)) (print "convertToCel: called; sender " sender) @[ @cel setDoubleValue: (f2c @[ @far doubleValue])]) (- VOID ((convertToFar: ID sender)) (print "convertToFar: called; sender " sender) @[ @far setDoubleValue: (c2f @[ @cel doubleValue ] )]) ) (objc:nsapplication-main) |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Controlling where PROFILE goes?: 00026, felix winkelmann |
|---|---|
| Next by Date: | How to use the simple-macros egg?: 00026, Andrew Wilcox |
| Previous by Thread: | Controlling where PROFILE goes?i: 00026, Reed Sheridan |
| Next by Thread: | Re: zobjc egg: 00026, felix winkelmann |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |