Giter Club home page Giter Club logo

Comments (4)

enebo avatar enebo commented on August 28, 2024

@edubkendo You know what the problem is right? c:/blah is being treated as a URL and it is trying to figure out what scheme 'c' is. Whatever is invoking this can fix it by appending: file:/// onto the front of that path and it should fix the issue.

from jrubyfx.

edubkendo avatar edubkendo commented on August 28, 2024

Nope, it's still choking somewhere. So, I made a simple test case.
Two files, hello.rb and launcher.rb (and hello.fxml which we'll get to in a minute)

With launcher.rb like this:

rb = "file:///C:\\Users\\edub\\projects\\jrubyfx\\HelloTest\\src\\hello.rb"
require rb

It returns the error:

LoadError: no such file to load -- file:///C:/Users/edub/projects/jrubyfx/HelloT
est/src/hello
  require at org/jruby/RubyKernel.java:1027
  require at c:/jruby-1.7.2/lib/ruby/shared/rubygems/custom_require.rb:36
   (root) at launcher.rb:2

It seems to be stripping off the .rb, and then require can't find the file. Now, If I change that to

rb = "C:\\Users\\edub\\projects\\jrubyfx\\HelloTest\\src\\hello.rb"
require rb

or even just:

rb="hello.rb"
require rb

Then it works fine, even if hello.rb is a jrubyfx app, unless hello.rb has a Controller call load_fxml, something like this:

require 'jrubyfx'

class HelloTestApplication < JRubyFX::Application
  def start(stage)
    with(stage, title: "HelloTest", width: 600, height: 400)
    HelloTestController.load_fxml("hello.fxml", stage)
    stage.show()
  end
end

class HelloTestController < JRubyFX::Controller

end

HelloTestApplication.launch

Then it breaks, and we get the error from before. Easy enough to avoid for now, since jrubyfx-generator no longer automatically launches the app on Windows, but something to look into?

from jrubyfx.

byteit101 avatar byteit101 commented on August 28, 2024
 file:///C:\Users\bla...

means

file:// => file protocol

/C:\Users\bla... => path. note the begining slash. since linux and mac have paths that look like /home/bla, this is valid for not windows, unless I am missing something or it automatically removes it.

about the fxml stuff, hmm, iteresting. also is this from the gem or master? master has changed the syntax a bit

from jrubyfx.

edubkendo avatar edubkendo commented on August 28, 2024

That's interesting. So, when you mentioned it, I checked, and my copy of master on Windows was a few commits behind. Merging in the recent syntax changes and changing hello.rb to match the new syntax fixes this problem. So, whatever was causing the problem was in the old "load_fxml" I guess, and went away when that did.

A couple of things to mention, jrubyfx-generator looks to have been updated with the new syntax EXCEPT that it still creates the new controller as a subclass of JRubyFX::Controller" but it needs toinclude` it instead. I got this error :

TypeError: superclass must be a Class (#<Class:JRubyFX::Controller> given)

until I peeked at Demo.rb and figured out the difference, looks like that is a module instead of a class now?

Just pushed changes to my branch that fix it, and went ahead and removed the check for Windows, since the root of the problem (whatever was in 'load_fxml' that caused this error on Windows) is fixed now due to the syntax changes.

Also, the GettingStarted guide has all the old syntax in it, as it was the first place I looked a minute ago to try to see what needed changing. Is the syntax likely to continue changing quite a lot, or can that be updated? Anyways, going to close this issue, since load_fxml is gone, and will make PR with fix for generator.

from jrubyfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.