User:Kevin Reid/Mac open event handler test

Can we have an E-on-Java app that handles Mac open events using the Apple Java extensions?

This does the obvious thing, but doesn't actually receive open events. Perhaps there is a which-thread-is-the-listener-invoked-on problem?

println("mainline a") interp.waitAtTop(when (currentVat.morphInto("awt")) -> {  println("getting App")   def app := .getApplication   println("installing listener")   app.addApplicationListener(def lis { to handleOpenFile(ev) { try { println(`got event $ev`) println(ev.getFilename) } catch p { println(`$p${p.eStack}`) }    }      match msg { println(`got msg $msg`) }  })   println("all set") }) println("mainline b; blocking") interp.blockAtTop
 * 1) !/usr/bin/env rune
 * 1) For something that might work in SWT see https://www.kallisti.net.nz/trac/emusicj/browser/trunk/macsrc/nz/net/kallisti/emusicj/mac/OpenDocHandler.java (directly registering an AppleEvent handler)

History

 * Written 2008-01-28.
 * Last experimented with 2009-05-12.
 * Published here 2010-10-01.