|
Re: zobjc egg: msg#00036lisp.scheme.chicken
Splendid! I can't wait to get home to try it out. Note that I have no problems dumping my old objc egg, so you should use the name objc instead. cheers, felix On 12/9/05, Zbigniew <zbigniewsz@xxxxxxxxx> wrote: > 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) > > > _______________________________________________ > Chicken-users mailing list > Chicken-users@xxxxxxxxxx > http://lists.nongnu.org/mailman/listinfo/chicken-users > |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: CMakeLists.txt CYGWIN vs. CMAKE_COMPILER_IS_GNUCC: 00036, felix winkelmann |
|---|---|
| Next by Date: | Re: How to use the simple-macros egg?: 00036, felix winkelmann |
| Previous by Thread: | zobjc eggi: 00036, Zbigniew |
| Next by Thread: | How to use the simple-macros egg?: 00036, Andrew Wilcox |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |