shoes 4.0.0.pre11 → 4.0.0.pre12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/bin/shoes-stub +8 -0
  3. data/lib/shoes/samples.rb +8 -0
  4. data/samples/README +122 -0
  5. data/samples/avatar.png +0 -0
  6. data/samples/blue-box.png +0 -0
  7. data/samples/class-book.yaml +387 -0
  8. data/samples/class_book.rb +46 -0
  9. data/samples/cy.png +0 -0
  10. data/samples/expert_definr.rb +24 -0
  11. data/samples/expert_funnies.rb +60 -0
  12. data/samples/expert_game_of_life.rb +224 -0
  13. data/samples/expert_irb.rb +109 -0
  14. data/samples/expert_minesweeper.rb +272 -0
  15. data/samples/expert_othello.rb +323 -0
  16. data/samples/expert_pong.rb +69 -0
  17. data/samples/expert_snake.rb +88 -0
  18. data/samples/expert_tankspank.rb +425 -0
  19. data/samples/expert_tetris.rb +322 -0
  20. data/samples/good_arc.rb +51 -0
  21. data/samples/good_bounce.rb +34 -0
  22. data/samples/good_clock.rb +55 -0
  23. data/samples/good_displace.rb +99 -0
  24. data/samples/good_follow.rb +27 -0
  25. data/samples/good_image_dl.rb +13 -0
  26. data/samples/good_potato_chopping.rb +23 -0
  27. data/samples/good_psychidelic_circles.rb +73 -0
  28. data/samples/good_reminder.rb +163 -0
  29. data/samples/good_vjot.rb +65 -0
  30. data/samples/lib/require_me.rb +6 -0
  31. data/samples/loogink.png +0 -0
  32. data/samples/menu-corner1.png +0 -0
  33. data/samples/menu-corner2.png +0 -0
  34. data/samples/menu-gray.png +0 -0
  35. data/samples/menu-left.png +0 -0
  36. data/samples/menu-right.png +0 -0
  37. data/samples/menu-top.png +0 -0
  38. data/samples/nks_booklist.rb +25 -0
  39. data/samples/nks_breadsticks.rb +8 -0
  40. data/samples/nks_dancing_circle.rb +14 -0
  41. data/samples/nks_dictionary.rb +24 -0
  42. data/samples/nks_edit_box.rb +5 -0
  43. data/samples/nks_edit_line.rb +7 -0
  44. data/samples/nks_notes.rb +16 -0
  45. data/samples/nks_poem.rb +23 -0
  46. data/samples/nks_self.rb +7 -0
  47. data/samples/nks_text_sizes.rb +11 -0
  48. data/samples/nks_trurl.rb +6 -0
  49. data/samples/potato_chopping/1258_s001.gif +0 -0
  50. data/samples/potato_chopping/1258_s002.gif +0 -0
  51. data/samples/potato_chopping/1258_s003.gif +0 -0
  52. data/samples/potato_chopping/1258_s004.gif +0 -0
  53. data/samples/potato_chopping/1258_s005.gif +0 -0
  54. data/samples/potato_chopping/1258_s006.gif +0 -0
  55. data/samples/potato_chopping/1258_s007.gif +0 -0
  56. data/samples/potato_chopping/1258_s008.gif +0 -0
  57. data/samples/potato_chopping/1258_s009.gif +0 -0
  58. data/samples/potato_chopping/1258_s010.gif +0 -0
  59. data/samples/potato_chopping/1258_s011.gif +0 -0
  60. data/samples/potato_chopping/1258_s012.gif +0 -0
  61. data/samples/potato_chopping/1258_s013.gif +0 -0
  62. data/samples/potato_chopping/1258_s014.gif +0 -0
  63. data/samples/potato_chopping/1258_s015.gif +0 -0
  64. data/samples/potato_chopping/1258_s016.gif +0 -0
  65. data/samples/potato_chopping/1258_s017.gif +0 -0
  66. data/samples/potato_chopping/1258_s018.gif +0 -0
  67. data/samples/potato_chopping/1258_s019.gif +0 -0
  68. data/samples/potato_chopping/1258_s020.gif +0 -0
  69. data/samples/potato_chopping/1258_s021.gif +0 -0
  70. data/samples/potato_chopping/1258_s022.gif +0 -0
  71. data/samples/potato_chopping/1258_s023.gif +0 -0
  72. data/samples/potato_chopping/1258_s024.gif +0 -0
  73. data/samples/potato_chopping/1258_s025.gif +0 -0
  74. data/samples/potato_chopping/1258_s026.gif +0 -0
  75. data/samples/potato_chopping/1258_s027.gif +0 -0
  76. data/samples/potato_chopping/1258_s028.gif +0 -0
  77. data/samples/potato_chopping/1258_s029.gif +0 -0
  78. data/samples/potato_chopping/1258_s030.gif +0 -0
  79. data/samples/potato_chopping/1258_s031.gif +0 -0
  80. data/samples/potato_chopping/1258_s032.gif +0 -0
  81. data/samples/potato_chopping/1258_s033.gif +0 -0
  82. data/samples/potato_chopping/1258_s034.gif +0 -0
  83. data/samples/potato_chopping/1258_s035.gif +0 -0
  84. data/samples/potato_chopping/1258_s036.gif +0 -0
  85. data/samples/potato_chopping/1258_s037.gif +0 -0
  86. data/samples/potato_chopping/1258_s038.gif +0 -0
  87. data/samples/potato_chopping/1258_s039.gif +0 -0
  88. data/samples/potato_chopping/1258_s040.gif +0 -0
  89. data/samples/potato_chopping/1258_s041.gif +0 -0
  90. data/samples/potato_chopping/1258_s042.gif +0 -0
  91. data/samples/potato_chopping/1258_s043.gif +0 -0
  92. data/samples/potato_chopping/1258_s044.gif +0 -0
  93. data/samples/potato_chopping/1258_s045.gif +0 -0
  94. data/samples/potato_chopping/1258_s046.gif +0 -0
  95. data/samples/potato_chopping/1258_s047.gif +0 -0
  96. data/samples/potato_chopping/1258_s048.gif +0 -0
  97. data/samples/potato_chopping/1258_s049.gif +0 -0
  98. data/samples/potato_chopping/1258_s050.gif +0 -0
  99. data/samples/potato_chopping/1258_s051.gif +0 -0
  100. data/samples/potato_chopping/1258_s052.gif +0 -0
  101. data/samples/potato_chopping/1258_s053.gif +0 -0
  102. data/samples/potato_chopping/1258_s054.gif +0 -0
  103. data/samples/potato_chopping/1258_s055.gif +0 -0
  104. data/samples/potato_chopping/1258_s056.gif +0 -0
  105. data/samples/potato_chopping/1258_s057.gif +0 -0
  106. data/samples/potato_chopping/1258_s058.gif +0 -0
  107. data/samples/potato_chopping/1258_s059.gif +0 -0
  108. data/samples/red-box.png +0 -0
  109. data/samples/shape_arc_to.rb +10 -0
  110. data/samples/simple-form.shy +0 -0
  111. data/samples/simple_accordion.rb +98 -0
  112. data/samples/simple_alert.rb +10 -0
  113. data/samples/simple_altered_para.rb +11 -0
  114. data/samples/simple_anim_shapes.rb +18 -0
  115. data/samples/simple_anim_text.rb +14 -0
  116. data/samples/simple_animate.rb +12 -0
  117. data/samples/simple_arc.rb +25 -0
  118. data/samples/simple_attach.rb +26 -0
  119. data/samples/simple_border_image.rb +9 -0
  120. data/samples/simple_borderless.rb +4 -0
  121. data/samples/simple_bounce.rb +27 -0
  122. data/samples/simple_breadsticks.rb +11 -0
  123. data/samples/simple_breadsticks2.rb +11 -0
  124. data/samples/simple_brightness_transitions.rb +16 -0
  125. data/samples/simple_button_animate.rb +17 -0
  126. data/samples/simple_buttons.rb +4 -0
  127. data/samples/simple_calc.rb +67 -0
  128. data/samples/simple_calc_2.rb +49 -0
  129. data/samples/simple_clipboard.rb +17 -0
  130. data/samples/simple_color_selector.rb +11 -0
  131. data/samples/simple_color_transitions.rb +12 -0
  132. data/samples/simple_concentric_circles.rb +9 -0
  133. data/samples/simple_console.rb +12 -0
  134. data/samples/simple_control_sizes.rb +25 -0
  135. data/samples/simple_count_and_draw.rb +19 -0
  136. data/samples/simple_curve.rb +34 -0
  137. data/samples/simple_dialogs.rb +33 -0
  138. data/samples/simple_dialogs_outside.rb +17 -0
  139. data/samples/simple_displace.rb +16 -0
  140. data/samples/simple_downloader.rb +29 -0
  141. data/samples/simple_draw.rb +16 -0
  142. data/samples/simple_editor.rb +30 -0
  143. data/samples/simple_face.rb +15 -0
  144. data/samples/simple_flashing.rb +22 -0
  145. data/samples/simple_flow_wrap.rb +12 -0
  146. data/samples/simple_font.rb +18 -0
  147. data/samples/simple_form.rb +30 -0
  148. data/samples/simple_fullscreen.rb +5 -0
  149. data/samples/simple_gradient_shapes.rb +23 -0
  150. data/samples/simple_guess_game.rb +30 -0
  151. data/samples/simple_image_as_stroke.rb +22 -0
  152. data/samples/simple_image_fill.rb +13 -0
  153. data/samples/simple_image_stroke.rb +13 -0
  154. data/samples/simple_info.rb +10 -0
  155. data/samples/simple_iterated_content.rb +8 -0
  156. data/samples/simple_keypress.rb +15 -0
  157. data/samples/simple_logo_display.rb +15 -0
  158. data/samples/simple_loogink_cy.rb +33 -0
  159. data/samples/simple_lorem_ipsum.rb +19 -0
  160. data/samples/simple_manual.rb +5 -0
  161. data/samples/simple_menu.rb +42 -0
  162. data/samples/simple_mouse_follow.rb +9 -0
  163. data/samples/simple_oval.rb +6 -0
  164. data/samples/simple_polygon_line.rb +19 -0
  165. data/samples/simple_position_as_we_go.rb +10 -0
  166. data/samples/simple_progress_bar.rb +15 -0
  167. data/samples/simple_random_bubbles.rb +15 -0
  168. data/samples/simple_require.rb +9 -0
  169. data/samples/simple_sample_executor.rb +7 -0
  170. data/samples/simple_sample_executor_all.rb +14 -0
  171. data/samples/simple_sesame_street_shoes.rb +6 -0
  172. data/samples/simple_shoes_intro.rb +22 -0
  173. data/samples/simple_slide.rb +57 -0
  174. data/samples/simple_stack_flow_buttons.rb +16 -0
  175. data/samples/simple_stripes.rb +9 -0
  176. data/samples/simple_system_background.rb +5 -0
  177. data/samples/simple_text_movement.rb +8 -0
  178. data/samples/simple_tictactoe.rb +224 -0
  179. data/samples/simple_timer.rb +16 -0
  180. data/samples/simple_translate.rb +10 -0
  181. data/samples/simple_visibility.rb +20 -0
  182. metadata +186 -7
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # based on the cairo curve_to example
4
+ # http://www.cairographics.org/samples/curve_to/
5
+ #
6
+ Shoes.app do
7
+ x = 25.6
8
+ y = 128.0
9
+
10
+ x1 = 102.4
11
+ y1 = 230.4
12
+
13
+ x2 = 153.6
14
+ y2 = 25.6
15
+
16
+ x3 = 230.4
17
+ y3 = 128.0
18
+
19
+ nofill
20
+ strokewidth 10.0
21
+ shape do
22
+ move_to x, y
23
+ curve_to x1, y1, x2, y2, x3, y3
24
+ end
25
+
26
+ strokewidth 6.0
27
+ stroke rgb(1.0, 0.2, 0.2, 0.6)
28
+ shape do
29
+ move_to x, y
30
+ line_to x1, y1
31
+ move_to x2, y2
32
+ line_to x3, y3
33
+ end
34
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app width: 300, height: 150, margin: 10 do
3
+ def answer(v)
4
+ @answer.replace v.inspect
5
+ end
6
+
7
+ button "Alert" do
8
+ alert 'Just a simple alert'
9
+ end
10
+ button "Ask" do
11
+ answer ask("What is your name?")
12
+ end
13
+ button "Confirm" do
14
+ answer confirm("Would you like to proceed?")
15
+ end
16
+ button "Open File..." do
17
+ answer ask_open_file
18
+ end
19
+ button "Save File..." do
20
+ answer ask_save_file
21
+ end
22
+ button "Open Folder..." do
23
+ answer ask_open_folder
24
+ end
25
+ button "Save Folder..." do
26
+ answer ask_save_folder
27
+ end
28
+ button "Color" do
29
+ answer ask_color("Pick a Color")
30
+ end
31
+
32
+ @answer = para "Answers appear here"
33
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # testing dialog options inside and outside of Shoes.app.
3
+ # Quite annoying, I know.
4
+
5
+ alert 'This alert should pop up before you even see a window!'
6
+ if confirm 'Do you really want to see that window?'
7
+ Shoes.app do
8
+ button 'alert' do
9
+ alert 'You pressed a button.'
10
+ end
11
+ button 'confirm' do
12
+ confirm 'You sure?'
13
+ end
14
+ end
15
+ else
16
+ alert 'Ok :-( goodbye.'
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ # Shoes 3 doesn't support button.text
4
+ position_report = ->(button, button_text) { @position_report.replace "#{button_text}: (#{button.left}, #{button.top})" }
5
+ flow margin: 12 do
6
+ # Set up three buttons
7
+ button "One", click: proc { |button| position_report.call(button, "One") }
8
+ @two = button "Two", click: proc { |button| position_report.call(button, "Two") }
9
+ button "Three", click: proc { |button| position_report.call(button, "Three") }
10
+ @position_report = para ''
11
+ # Bounce the second button
12
+ animate do |i|
13
+ @two.displace(0, (Math.sin(i) * 6).to_i)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ background "#eee"
4
+ @list = stack do
5
+ para "Enter a URL to download:", margin: [10, 8, 10, 0]
6
+ flow margin: 10 do
7
+ @url = edit_line width: -120
8
+ button "Download", width: 120 do
9
+ @list.append do
10
+ stack do
11
+ background "#eee".."#ccd"
12
+ stack margin: 10 do
13
+ dl = nil
14
+ para @url.text, " [", link("cancel") { dl.abort }, "]", margin: 0
15
+ status = inscription "Beginning transfer.", margin: 0
16
+ p = progress width: 1.0, height: 14
17
+ dl = download @url.text, save: File.basename(@url.text),
18
+ progress: proc { |d|
19
+ status.text = "Transferred #{d.transferred} of #{d.length} bytes (#{d.percent}%)"
20
+ p.fraction = d.percent * 0.01
21
+ },
22
+ finish: proc { status.text = "Download completed" }
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ background "#999"
4
+ stroke "#000"
5
+ x = nil
6
+ y = nil
7
+ motion do |x2, y2|
8
+ if x && y && ((x != x2) || (y != y2))
9
+ append do
10
+ line x, y, x2, y2
11
+ end
12
+ end
13
+ x = x2
14
+ y = y2
15
+ end
16
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ str = ""
3
+ t = nil
4
+ Shoes.app height: 500, width: 450 do
5
+ background rgb(77, 77, 77)
6
+ stack margin: 10 do
7
+ para span("TEXT EDITOR", stroke: red, fill: white), " * USE ALT-Q TO QUIT", stroke: white
8
+ end
9
+ stack margin: 10 do
10
+ t = para "", font: "Monospace 12px", stroke: white
11
+ t.cursor = -1
12
+ end
13
+ keypress do |k|
14
+ case k
15
+ when String
16
+ str += k
17
+ when :backspace
18
+ str.slice!(-1)
19
+ when :tab
20
+ str += " "
21
+ when :alt_q
22
+ quit
23
+ when :alt_c
24
+ self.clipboard = str
25
+ when :alt_v
26
+ str += clipboard
27
+ end
28
+ t.replace str
29
+ end
30
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Smiling face by Coraline Clark (age 5), 2013
4
+ #
5
+ Shoes.app do
6
+ stack margin_top: 150, width: 1.0, height: 1.0 do
7
+ @oval = oval 200, 1, 200, 200, fill: mintcream
8
+ @hair = star 120, -80, 80, 80
9
+ @eye1 = star 290, 48, 10, 10, 6
10
+ @eye2 = star 320, 48, 10, 10, 6
11
+ @mouth = oval 310, 120, 70, 40, fill: red
12
+ @nose = line 310, 80, 340, 110
13
+ @line = line 310, 140, 380, 140
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app width: 300, height: 300 do
3
+ COLORS = Shoes::COLORS
4
+ background cadetblue
5
+ r = rect 100, 10, 100, 100, fill: red, strokewidth: 5, curve: 10, stroke: pink do
6
+ alert 'Yay!'
7
+ end
8
+ o = oval 100, 110, 100, fill: green, strokewidth: 10, stroke: white
9
+ para 'Shoes 4!!!!!!', left: 100, top: 70
10
+
11
+ size = COLORS.keys.size
12
+ j = 0
13
+ a = animate 1 do |i|
14
+ unless j == i
15
+ r.style fill: send(COLORS.keys[rand size]), stroke: send(COLORS.keys[rand size])
16
+ o.style fill: send(COLORS.keys[rand size]), stroke: send(COLORS.keys[rand size])
17
+ j = i
18
+ end
19
+ end
20
+
21
+ button('pause') { a.toggle }
22
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app width: 200 do
3
+ flow margin: 12, fill: red do
4
+ background red
5
+ # Set up three buttons
6
+ button "button 1"
7
+ button "button 2"
8
+ button "button 3"
9
+ button "button 4"
10
+ button "button 5"
11
+ end
12
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app height: 200 do
3
+ font File.join(Shoes::DIR, 'fonts/Coolvetica.ttf')
4
+ stack do
5
+ flow do
6
+ title 'Good Question'
7
+ para 'Arial (default)', left: 400, top: 20
8
+ end
9
+ flow do
10
+ title 'Cool Question', font: 'Coolvetica'
11
+ para 'Coolvetica', left: 400, top: 20
12
+ end
13
+ flow do
14
+ title 'Lucid Question', font: 'Lucida console'
15
+ para 'Lucida Console', left: 400, top: 20
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app width: 320, height: 420 do
3
+ static_dir = File.expand_path(File.join(__FILE__, ".."))
4
+ background File.join(static_dir, "menu-gray.png")
5
+ image File.join(static_dir, "menu-top.png"), height: 50
6
+ image File.join(static_dir, "menu-left.png"), top: 50, width: 55
7
+ image File.join(static_dir, "menu-right.png"), right: 0, top: 50, width: 55
8
+ image File.join(static_dir, "menu-corner1.png"), top: 0, left: 0
9
+ image File.join(static_dir, "menu-corner2.png"), right: 0, top: 0
10
+
11
+ stack margin: 40 do
12
+ stack margin: 10 do
13
+ para "Name"
14
+ @name = list_box items: ["Phyllis", "Ronald", "Wyatt"]
15
+ end
16
+ stack margin: 10 do
17
+ para "Address"
18
+ @address = edit_line
19
+ end
20
+ stack margin: 10 do
21
+ para "Phone"
22
+ @phone = edit_line
23
+ end
24
+ stack margin: 10 do
25
+ button "Save" do
26
+ Shoes.p [@name.text, @address.text, @phone.text]
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ button('fullscreen') { self.fullscreen = true }
4
+ button('turn back') { self.fullscreen = false }
5
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ strokewidth 3
4
+ eles = []
5
+ eles << oval(0, 0, 600, angle: 90)
6
+ eles << rect(50, 50, 350, 350, curve: 10)
7
+ eles << star(100, 100, 30, 200, 180)
8
+ eles << shape(200, 150, width: 300, height: 300) do
9
+ move_to 200, 200
10
+ line_to 200, 100
11
+ curve_to 100, 100, 20, 200, 50, 150
12
+ line_to 20, 100
13
+ end
14
+ eles << line(100, 100, 480, 480)
15
+
16
+ button 'change colors' do
17
+ eles.each do |ele|
18
+ colors = []
19
+ 4.times { colors << send(Shoes::COLORS.keys[rand(Shoes::COLORS.keys.size)]) }
20
+ ele.style fill: gradient(colors[0], colors[1]), stroke: gradient(colors[2], colors[3])
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ class Answer < Shoes::Widget
3
+ attr_reader :mark
4
+
5
+ def initialize_widget(word)
6
+ mark = nil
7
+ flow do
8
+ flow(width: 70, height: 20) { para word }
9
+ mark = image(File.expand_path(File.join(__FILE__, '../loogink.png')), width: 20, height: 20).hide
10
+ end
11
+ @mark = mark
12
+ end
13
+ end
14
+
15
+ Shoes.app width: 200, height: 85 do
16
+ stack width: 0.5, height: 1.0 do
17
+ background palegreen
18
+ para '1. apple'
19
+ ans = answer '2. tomato'
20
+ para '3. orange'
21
+ button('Ans.') { ans.mark.toggle }
22
+ end
23
+ stack width: 0.5, height: 1.0 do
24
+ background lightsteelblue
25
+ para '1. cat'
26
+ para '2. dog'
27
+ ans = answer '3. bird'
28
+ button('Ans.') { ans.mark.toggle }
29
+ end
30
+ end
@@ -0,0 +1,22 @@
1
+
2
+ # frozen_string_literal: true
3
+ Shoes.app width: 400, height: 400 do
4
+ cap [:rect, :curve, :project][rand 3]
5
+ background yellow
6
+ rect 0, 0, 100, 100
7
+ rect 100, 100, 100, 100
8
+ rect 200, 200, 100, 100
9
+ rect 0, 200, 100, 100
10
+ rect 200, 0, 100, 100
11
+ stroke File.join(Shoes::DIR, 'static/shoes-icon.png')
12
+ strokewidth 10
13
+ line 355, 180, 5, 111, strokewidth: 20
14
+ stroke red
15
+ line 0, 0, 100, 0
16
+ line 0, 100, 0, 0
17
+ line 300, 200, 200, 200
18
+ line 100, 200, 200, 100
19
+ stroke white
20
+ line 200, 200, 200, 300
21
+ line 300, 200, 200, 100
22
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ blue_box = File.expand_path(File.join(__FILE__, '../blue-box.png'))
4
+
5
+ rect 50, 50, 150, 150, strokewidth: 5, fill: pattern(blue_box)
6
+ rect 70, 70, 150, 150, strokewidth: 5, fill: pattern(blue_box)
7
+
8
+ oval 300, 50, 200, 200, strokewidth: 5, fill: pattern(blue_box)
9
+ oval 320, 70, 200, 200, strokewidth: 5, fill: pattern(blue_box)
10
+
11
+ star 120, 250, 17, 100, 50, strokewidth: 5, fill: pattern(blue_box)
12
+ star 160, 290, 17, 100, 50, strokewidth: 5, fill: pattern(blue_box)
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ red_box = File.expand_path(File.join(__FILE__, '../red-box.png'))
4
+
5
+ rect 50, 50, 150, 150, strokewidth: 10, fill: gray, stroke: pattern(red_box)
6
+ rect 120, 70, 150, 150, strokewidth: 10, fill: gray, stroke: pattern(red_box)
7
+
8
+ oval 300, 50, 200, 200, strokewidth: 10, fill: gray, stroke: pattern(red_box)
9
+ oval 350, 70, 200, 200, strokewidth: 10, fill: gray, stroke: pattern(red_box)
10
+
11
+ star 120, 250, 17, 100, 50, strokewidth: 5, fill: gray, stroke: pattern(red_box)
12
+ star 160, 290, 17, 100, 50, strokewidth: 5, fill: gray, stroke: pattern(red_box)
13
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ stack do
4
+ # para DIR # Not support. https://github.com/shoes/shoes4/issues/105
5
+ para Shoes::DIR
6
+ # para Shoes::App::DIR # Not support. https://github.com/shoes/shoes4/issues/105
7
+ para self.class
8
+ para Shoes.app {}.class
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ 10.times do |i|
4
+ button "hello#{i}"
5
+ image File.join(Shoes::DIR, 'static/shoes-icon.png')
6
+ edit_line
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ Shoes.app do
3
+ s = stack do
4
+ title 'come on press some keys'
5
+ end
6
+
7
+ keypress do |key|
8
+ s.append { para 'You pressed ' + key.to_s }
9
+ p key
10
+ end
11
+ keyrelease do |key|
12
+ s.append { para 'You released ' + key.to_s }
13
+ p key
14
+ end
15
+ end