JavaFX Example

Matthieu Vachon matthieu.o.vachon@gmail.com
Wed Nov 6 20:30:00 GMT 2013


On Wed, Nov 6, 2013 at 3:16 PM, Per Bothner <per@bothner.com> wrote:
>When I compile your example I get:
>
>/home/bothner/tmp/hello-world.scm:10:9: warning - no use of start
>/home/bothner/tmp/hello-world.scm:24:9: warning - no use of create-button
>
>This because when you compile with main, then functions are not implicitly
>exported.  This allows better optimization.  In this case start is
>optimized away, which is why you get the AbstractMethodError.

I thought it made no difference of having a main or not. I was under
the impression that not providing `module-export` ensured that all
function were exported explicitly.

In fact, I thought it was false-positives from Kawa unsed dectection mechanisms.

>
>I think this should be viewed as a Kawa bug, when the function overrides an
>inherited method, it should be viewed as being "used".

I agree

>
>(module-static #t) would make the methods static, which would not work.
>Unsure why you don't get the AbstractMethodError.
>
>I'm having some configuration issues; more later.  You could
>try removing the
>  (module-compile-options main: #t)

If there is no main method generated, then I guess the script would
need to be called from another file right?

>I did have to change:
>(define (create-button #!key (text #f) (event-handler #f)) :: <Button>
>to:
>(define (create-button #!key (text #f) (event-handler #f)) :: <javafx.scene.control.Button>

My initial version used aliases which I changed afterward, seems I
forgot this one.

Matt



More information about the Kawa mailing list