This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Android REPL - add* syntax-sugar not available in constructor


On 01/31/2012 06:55 PM, teyc wrote:


Per Bothner wrote:

However, it should be doable to use java.lang.reflect.Proxy, as long as the requested type is an interface (rather than an abstract class). The idea would be to write a utility class ProcedureInvocationHandler that implements InvocationHandler by calling applyN on the procedure.


That did the trick, and I now have the following working. It reads like Java :(

That's an improvement, but I was thinking the compiler would generate the Proxy automatically. And so I want ahead and implemented that ...

I'm hoping this might now work:

(*activity*:runOnUiThread
  (lambda ()
    (let
      ((button  (Button *activity*
                 text: "Push Me"
                 on-click-listener: (lambda (v) ...))))
      (*activity*:setContentView button))))

Please try it.

You might find these articles provide ideas:

http://per.bothner.com/blog/2011/JavaFX-using-Kawa-intro/
http://per.bothner.com/blog/2011/JavaFX-using-Kawa-animation/

These are for JavaFX 2.0, not Android, but using Kawa in similar ways.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]