lib/joyce/application.rb in joyce-0.1.3 vs lib/joyce/application.rb in joyce-0.1.4

- old
+ new

@@ -1,7 +1,10 @@ module Joyce class Application + DEFAULT_WIDTH = 800 + DEFAULT_HEIGHT = 600 + def initialize(headless: false) @headless = headless end def setup @@ -10,10 +13,14 @@ def tick # ... end + def click + # ... + end + def launch sim.conduct! setup window.show self @@ -34,10 +41,18 @@ def view @view ||= construct_view end def window - @window ||= @headless ? NullWindow.new(self) : ApplicationWindow.new(self) + @window ||= @headless ? NullWindow.new(self) : ApplicationWindow.new(self, width: width, height: height) + end + + def width + DEFAULT_WIDTH + end + + def height + DEFAULT_HEIGHT end private def construct_view self.class.view_class.new(self)