How do I get the window object from the controller, but in JRubyFX

91 views Asked by At

I'm trying to eventually have a desktop app that has one main window and controller that can open a temporary second window where the first window is temporarily disabled. I found this link for how to do that in javafx, but now I'm trying to get it to work in jrubyfx.

Here is essentially as far as I've gotten:

require 'other_controller'

class MainMenuController
  include JRubyFX::Controller
  fxml "MainMenu.fxml"

  def button_press
    new_stage = JRubyFX::DSL::Stage.new
    with(new_stage, title: "title") do
      new_stage.init_modality = :window_modal
      new_stage.init_owner = stage.get_window
      fxml OtherController
      show
    end
    # other code
  end
end

The error I get is that the get_window method isn't found. I know my issue is that I don't fully understand how to translate javafx into jrubyfx so if anybody has any insight on how to get the window, or any more insight to what I'm missing about jrubyfx syntax would be much appreciated.

Thank you!

0

There are 0 answers