Skip to content

Commit

Permalink
Use new fxml and css with main application
Browse files Browse the repository at this point in the history
  • Loading branch information
lexun committed Jan 25, 2015
1 parent f0ea33e commit d215bb4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
doc
coverage
doc
.jrubyfx_cache
.yardoc
10 changes: 6 additions & 4 deletions lib/launchpad/gui/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
module Launchpad
# Main application which is only created once at launch.
class Application < JRubyFX::Application
fxml_root 'lib/launchpad/gui/fxml'

# Automatically called on {Application.launch}
# @param [Java::JavafxStage::Stage] stage
# automatically provided when {.launch} is called.
def start(stage)
stage.title = 'Launchpad'
stage.width = 800
stage.height = 600
stage.show
with(stage, title: 'Launchpad', width: 800, height: 600) do
fxml 'main.fxml'
show
end
end
end
end
3 changes: 2 additions & 1 deletion spec/lib/launchpad/gui/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:stage) { double 'stage' }

before do
messages = [:title=, :width=, :height=, :show]
messages = [:title=, :width=, :height=, :fxml, :show]
messages.each { |message| allow(stage).to receive message }
subject.start stage
end
Expand All @@ -14,6 +14,7 @@
expect(stage).to have_received(:title=).with 'Launchpad'
expect(stage).to have_received(:width=).with 800
expect(stage).to have_received(:height=).with 600
expect(stage).to have_received(:fxml).with 'main.fxml'
expect(stage).to have_received(:show)
end

Expand Down

0 comments on commit d215bb4

Please sign in to comment.