Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/samples/simple-dialogs.rb
blob: a1b1a0802c832482e72beaef4d204aacd5404173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Shoes.app :width => 300, :height => 150, :margin => 10 do
  def answer(v)
    @answer.replace v.inspect
  end

  button "Ask" do
    answer ask("What is your name?")
  end
  button "Confirm" do
    answer confirm("Would you like to proceed?")
  end
  button "Open File..." do
    answer ask_open_file
  end
  button "Save File..." do
    answer ask_save_file
  end
  button "Open Folder..." do
    answer ask_open_folder
  end
  button "Save Folder..." do
    answer ask_save_folder
  end
  button "Color" do
    answer ask_color("Pick a Color")
  end

  @answer = para "Answers appear here"
end