Sha256: e4006c960ffe49cddf56aec26e901796f0a279ce380e534137503e84169c340a

Contents?: true

Size: 622 Bytes

Versions: 6

Compression:

Stored size: 622 Bytes

Contents

str, t = "", nil
Shoes.app :height => 500, :width => 450 do
  background rgb(77, 77, 77)
  stack :margin => 10 do
    para span("TEXT EDITOR", :stroke => red, :fill => white), " * USE ALT-Q TO QUIT", :stroke => white
  end
  stack :margin => 10 do
    t = para "", :font => "Monospace 12px", :stroke => white
    t.cursor = -1
  end
  keypress do |k|
    case k
    when String
      str += k
    when :backspace
      str.slice!(-1)
    when :tab
      str += "  "
    when :alt_q
      Shoes.quit
    when :alt_c
      self.clipboard = str
    when :alt_v
      str += self.clipboard
    end
    t.replace str
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 examples/legacy/not_checked/simple/editor.rb
scarpe-0.3.0 examples/legacy/not_checked/simple/editor.rb
scarpe-0.2.2 examples/legacy/not_checked/simple/editor.rb
lacci-0.2.1 examples/legacy/not_checked/simple/editor.rb
scarpe-0.2.1 examples/legacy/not_checked/simple/editor.rb
scarpe-0.2.0 examples/legacy/not_checked/simple/editor.rb