Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling JRubyApplication.set_on_action yields an Exception #53

Closed
komax opened this issue Jul 5, 2013 · 1 comment
Closed

Calling JRubyApplication.set_on_action yields an Exception #53

komax opened this issue Jul 5, 2013 · 1 comment

Comments

@komax
Copy link
Member

komax commented Jul 5, 2013

I program a bit on JavaFX for my GSoC project in jrubyfx. The form view example
http://docs.oracle.com/javafx/2/get_started/form.htm#BABHABBF
looks like this in jrubyfx
https://gist.github.com/komax/5933828
Everything works, except the set_on_action call back (with just puts, it works). On my linux mint 14 with oracle jdk7 and jruby master, I get this error:

% jruby form_javafx.rb
Exception in thread "JavaFX Application Thread" org.jruby.exceptions.RaiseException: (NameError) undefined local variable or method `actiongarget' for #<FormApp:0x7dc0e904>
at org.jruby.RubyBasicObject.method_missing(org/jruby/RubyBasicObject.java:1497)
at RUBY.method_missing(/home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/jrubyfx-1.0.0-java/lib/jrubyfx/dsl.rb:86)
at form_javafx.start(form_javafx.rb:48)
at org.jruby.gen.InterfaceImpl791640704.handle(org/jruby/gen/InterfaceImpl791640704.gen:13)
jruby form_javafx.rb  12,33s user 0,31s system 126% cpu 9,967 total
@byteit101
Copy link
Member

actiontarget = JavaFX::scene::text::Text.new
vs
actiongarget.text = "Sign in button pressed"

actiongarget != actiontarget

Also you should use the DSL instead of java-style add:

hbox(10) do
  alignment = :bottom_right
  button("Sign in") do
    set_on_action do
    ...
    end
  ..
  end
end

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants