Changeset 165 for trunk/samples

Show
Ignore:
Timestamp:
08/31/2007 11:50:49 (12 months ago)
Author:
why
Message:

* samples/calc.rb: fiddling with the background and layout a bit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/samples/calc.rb

    r120 r165  
    4040number = Calc.new 
    4141Shoes.app :height => 250, :width => 200 do 
     42  background "#EEC".."#996", :radius => 5, 
     43    :top => 2, :left => 2, :width => -4, :height => -4 
    4244 
    4345  stack :margin => 4 do 
    44     background rgb(240, 240, 210), :radius => 5 
    4546 
    46     stack do 
    47       number_field = text number.to_s 
     47    stack :margin => 8 do 
     48      number_field = text "<b>#{number}</b>" 
    4849    end 
    4950 
    5051    flow :width => 218, :margin => 4 do 
    5152      %w(7 8 9 / 4 5 6 * 1 2 3 - 0 Clr = +).each do |btn| 
    52         button btn, :width => 50, :height => 50 do 
     53        button btn, :width => 46, :height => 46 do 
    5354          method = case btn 
    5455            when /[0-9]/: 'press_'+btn 
     
    6263           
    6364          number.send(method) 
    64           number_field.replace number.to_s 
     65          number_field.replace "<b>#{number} </b>" 
    6566        end 
    6667      end