Sha256: b6c39fdef83b8560ca6646fb7694df536e70bebb24291d52bc6215ea2108f338
Contents?: true
Size: 1.01 KB
Versions: 24
Compression:
Stored size: 1.01 KB
Contents
require '../lib/green_shoes' Shoes.app height: 250, width: 198 do def do_calc @number = @previous.send(@op, @number) if @op @op = nil end @previous, @number, @op = 0, 0, nil background rgb(235, 235, 210) flow margin: 5 do flow height: 240, width: 190, margin: [2, 5, 0, 0] do background "#996".."#333", :curve => 5 number_field = para fg(strong(@number), white), margin: 8 flow width: 218 do %w(7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +).each do |btn| button btn, width: 46, height: 46 do case btn when /[0-9]/ @number = @number.to_i * 10 + btn.to_i when 'Clr' @previous, @number, @op = 0, 0, nil when '=' do_calc else do_calc @previous, @number = @number, nil @op = btn end number_field.replace fg(strong(@number), white) end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems