<GGibson[m]>
oh ok -- so I'll need to learn some java then
<byteit101[m]>
At least reading it to translate to ruby
<GGibson[m]>
sure
<byteit101[m]>
the big thing to know is that fxmlloader is the only very different line
<GGibson[m]>
I will probably not be using fxml
<GGibson[m]>
What I do is generate dsl script from a database structure record
<GGibson[m]>
I'm looking to eval(thingy).call(stage) it
<GGibson[m]>
that direction
<byteit101[m]>
Ah, that's an interesting approach
<GGibson[m]>
I do things like that ;)
<GGibson[m]>
the reason I'm doing it is that I plan to construct a window that edits those records a la IDE
<GGibson[m]>
utterly avoiding xml like the plague
<byteit101[m]>
stage = Stage.new; stage.scene = eval(thingy); stage.title = "foo"; stage.show; #where thingy evaluates to a Scene Object
<GGibson[m]>
Stage is an unknown constant -- ::JRubyFX::Stage?
<byteit101[m]>
> utterly avoiding xml like the plague
<byteit101[m]>
I've found xml is most useful and intuitive for UI's actually. FXML is only topped by XAML (Windows)
<byteit101[m]>
Ah, right, constants are fun. You can either import all of them, or do it selectively.
<GGibson[m]>
well, my script generator allows me to drop in script snippets at will anyplace and I dig the flexibility it will give me.
<GGibson[m]>
ah ok
<GGibson[m]>
I'll sniff the github source
<byteit101[m]>
If you are in a class that extends JRubyFX the lookup will work
<byteit101[m]>
otherwise, stage is from javafx.stage.Stage
<GGibson[m]>
I subclassed JRubyFX::Application
<byteit101[m]>
Yes, that's an override of javafx.application.Application
<GGibson[m]>
ok
<byteit101[m]>
the FX classes can always be looked up via JRubyFX::FXImports::
<byteit101[m]>
but you can import them into other contexts, such as via
<byteit101[m]>
include JRubyFX
<byteit101[m]>
If you subclassed JRubyFX::Application, then the constants *should* be there for you
<GGibson[m]>
ok great
<byteit101[m]>
out of curiosity, how are you building `thingy` above? strings or an ast library?
<GGibson[m]>
I generate a string
<GGibson[m]>
hrm
<GGibson[m]>
I get this error: /opt/jruby-9.2.14.0/lib/ruby/stdlib/irb/init.rb:280: warning: LoadError: load error: ./src/studio -- java.lang.IllegalStateException: Not on FX application thread; currentThread = main
<GGibson[m]>
but I'm using run_later for the call it complains about
<byteit101[m]>
are you in a callback?
<byteit101[m]>
Oh, have you launched the application?
<GGibson[m]>
no, not yet
<GGibson[m]>
ok
<GGibson[m]>
I think I see
<GGibson[m]>
so, the param I pass launch does it get fed to initialize?
<GGibson[m]>
or just calls stage
<GGibson[m]>
?
<byteit101[m]>
It's weird, let me look up the docs
<GGibson[m]>
thanks
<GGibson[m]>
Are you looking for more contributors to jrubyfx? a Buddy of mine in europe is fantastic on java
<byteit101[m]>
I'd recommend you do all stuff inside the start method, and nothing outside. If you'd like, you can do a require './rest_of_code' inside start, and then put all the code in rest_of_code.rb
<GGibson[m]>
I just tested it to
<GGibson[m]>
excellent, that is good info
<GGibson[m]>
ok
<GGibson[m]>
Hey, thanks for your help. I think I am starting to get it now
<byteit101[m]>
NP
<GGibson[m]>
Hey! it works
<GGibson[m]>
got a window to come up that is completely defined in a database structured record
<GGibson[m]>
nice
<byteit101[m]>
Nice!
<GGibson[m]>
kinda worried though - looks like I get only ONE opportunity to define windows
<GGibson[m]>
I would like to show/hide tool pallets
<byteit101[m]>
No, you can define them whenever you want
<GGibson[m]>
oh?
<GGibson[m]>
outside of start()?
<byteit101[m]>
Again: I recommend putting your main loop inside of start, but yes: class App < JRubyFX::Application; def start(_); 5.times{|i| Thread.new { sleep i; run_later { Stage.new.tap{|x|x.title=i.to_s}.show}} }; end; end; App.launch
<GGibson[m]>
ok, I think I get it
<GGibson[m]>
I can work with that
<byteit101[m]>
In JavaFX, consider the "main" thread to be only useful for starting javafx, and nothing more :-)
<byteit101[m]>
Like many GUI toolkits, it's heavily evented
eregon[m] has quit [Quit: Idle for 30+ days]
truths33ker[m] has joined #jruby
<truths33ker[m]>
hi byteit101
<truths33ker[m]>
I wanted to ask in which manner i could contribute to the project?
<truths33ker[m]>
the jrubyxf project to be precize
<GGibson[m]>
byteit101: truths33ker is the friend in Europe I spoke of
<GGibson[m]>
btw: your tips helped me put up my very first windows last night
<GGibson[m]>
success
<byteit101[m]>
It's a mostly stable and minimal wrapper project at this point. The only excitement is going to be deleting some hacks once I finish https://github.com/jruby/jruby/pull/6422, but I know that right now, the jarify stuff is sketchy: https://github.com/jruby/jrubyfx/issues/118 Documentation for translation of javadoc=> our syntax could use some reference, but the biggest doc is jrubyfx's differences from java, such as
<byteit101[m]>
injected @stage, etc: https://github.com/jruby/jrubyfx/issues/122 If you want to help with triage of issues, that might be helpful, but that might change siginificantly with my PR in JRuby proper. I'll try to push a branch with changes to support that soon if you want to do that (or help out testing). Another possibility: new helpers to make things less java-like but more ruby-like
<byteit101[m]>
truths33ker: there's some ideas, I'm sure there are more if you are interested in a specific thing I haven't mentioned
<byteit101[m]>
truths33ker: Ritght, jarify issue linked is going to be solved with the PR I think, scratch that one
<truths33ker[m]>
I read your interesting reaction I wanted to say that i would like to start with software testing
<truths33ker[m]>
at first
<byteit101[m]>
Cool, of the existing code (don't test fxml) or post-pr code (fxml, mostly)?
<truths33ker[m]>
understood
<byteit101[m]>
Oh, I also have a thing importing all the rest of the classes sitting here not committed yet
ur5us has joined #jruby
<truths33ker[m]>
oh sorry got a call
<byteit101[m]>
Another idea: binding/observable api that is more rubyish, but that will probably require the PR to function well
<truths33ker[m]>
sounds good I choose for the rubyfied method