Skip to content

Commit

Permalink
Reached a basic consensus in Shoes/shoes4 issue shoes#6.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbb committed Jun 1, 2012
1 parent c47fa3d commit f8c5b7c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/shoes/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class App
include Shoes::ElementMethods

def initialize &blk
@gui = Shoes.backend::App.new(Swt.display)
@gui = Shoes.backend::App.new
instance_eval &blk
@gui.open
end
Expand Down
11 changes: 1 addition & 10 deletions lib/shoes/swing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
#require 'swing'

module Shoes
#include Swing
end

module Shoes
module Swing
module App; end
module Check; end
end
class App; include Swing::App end
class Check; include Swing::Check end
module Swing; end
end

require 'shoes/swing/app'
Expand Down
6 changes: 3 additions & 3 deletions lib/shoes/swing/app.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Shoes::Swing::App
def gui_init
class Shoes::Swing::App
def initialize
@shell = 'create Swing object'
end

attr_reader :shell

def gui_open
def open
# bla bla bla
end
end
4 changes: 2 additions & 2 deletions lib/shoes/swing/check.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Shoes::Swing::Check
def gui_init_open app
class Shoes::Swing::Check
def initialize app
@real = 'create Swing object'
end
attr_accessor :real
Expand Down
4 changes: 3 additions & 1 deletion lib/shoes/swt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
require 'swt'

module Shoes
module Swt
module Swt; end
def self.display
@display ||= ::Swt::Widgets::Display.new
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/shoes/swt/app.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Shoes::Swt::App
def initialize(display)
@shell = Swt::Widgets::Shell.new display
def initialize
@shell = Swt::Widgets::Shell.new Shoes.display
end

attr_reader :shell
Expand Down

0 comments on commit f8c5b7c

Please sign in to comment.