Sha256: 09da6b394c6a57f3c322f084d500a771458abeb88769b375445517807c468889

Contents?: true

Size: 663 Bytes

Versions: 12

Compression:

Stored size: 663 Bytes

Contents

require 'green_shoes'

# The same as gallery2 : http://shoes-tutorial-note.heroku.com/html/01110_Fancy_Gallery_1-5.html
# But revised for Green Shoes

Shoes.app width: 200, height: 200 do
  background mintcream
  flow margin: 5 do
    flow height: 190 do
      background File.join(DIR, '../samples/shell.png'), curve: 5
      @line = para ' '
      @line.cursor = -1
    end
  end

  keypress do |k|
    #p k
    msg = case k
      when 'BackSpace'; @line.text[0..-2]
      else
        k.length == 1 ? @line.text + k : nil
    end
    (@line.text = strong fg msg.gsub('&', '&amp;').gsub('<', '&lt;'), white) if msg
    flush
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
green_shoes-1.1.374 samples/sample51.rb
green_shoes-1.1.373 samples/sample51.rb
green_shoes-1.1.367 samples/sample51.rb
green_shoes-1.1.366 samples/sample51.rb
green_shoes-1.1.365 samples/sample51.rb
green_shoes-1.1.364 samples/sample51.rb
green_shoes-1.1.363 samples/sample51.rb
green_shoes-1.1.362 samples/sample51.rb
green_shoes-1.1.358 samples/sample51.rb
green_shoes-1.1.357 samples/sample51.rb
green_shoes-1.1.354 samples/sample51.rb
green_shoes-1.1.348 samples/sample51.rb