Created
November 16, 2010 14:39
-
-
Save ashbb/701880 to your computer and use it in GitHub Desktop.
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
require '../lib/green_shoes' | |
DATA = %w{ place plan plant plot face race rails ruby train trouble double } | |
MSG = "Enter a search." | |
Shoes.app title: "Search sample", width: 300, height: 400 do | |
def search input | |
input.empty? ? [] : DATA.select{|w| w.include? input} | |
end | |
edit_line width: 300 do |el| | |
results = search el.text | |
@results.clear do | |
results.empty? ? para(MSG) : | |
results.each do |word| | |
stack do | |
background forestgreen, curve: 6 | |
para ' ', fg(strong(word), white) | |
end | |
end | |
end | |
end | |
@results = flow{para MSG} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment