Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependency renamed to Toolkit and textfield class started
- Loading branch information
1 parent
b5abdfe
commit b80a9c8
Showing
8 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
%w(initializer dependency view window).each do |file| | ||
%w(initializer toolkit view window).each do |file| | ||
require File.join(File.dirname(__FILE__), "anvil-gui", file) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Anvil | ||
module GUI | ||
class TextField | ||
attr_accessor :text | ||
|
||
def initialize(toolkit) | ||
@toolkit = toolkit | ||
@name = name | ||
@real_window = create | ||
end | ||
|
||
def create | ||
load_gui_constant(@toolkit, "TextField").new @toolkit.initializer.app, @name | ||
end | ||
|
||
def button(name, options = {}) | ||
load_gui_constant(@toolkit, "Button").new @real_window, name | ||
end | ||
end | ||
end | ||
end |
7 changes: 4 additions & 3 deletions
7
anvil-gui/lib/anvil-gui/dependency.rb → anvil-gui/lib/anvil-gui/toolkit.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
require File.join(File.dirname(__FILE__), "..", "spec_helper") | ||
|
||
include Anvil::GUI | ||
|
||
describe Anvil::GUI, "window" do | ||
it "should be friggin cool" do | ||
window "Test Window" do | ||
button "Click me!" | ||
describe "The DSL for" do | ||
describe Anvil::GUI, "window" do | ||
it "should be friggin cool" do | ||
window "Test Window" do | ||
button "Click me!" | ||
end | ||
end | ||
end | ||
end |