glimmer-dsl-swt 4.18.7.6 → 4.20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/README.md +34 -21
  4. data/RUBY_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/bin/girb +10 -9
  7. data/bin/girb_runner.rb +8 -3
  8. data/bin/glimmer +10 -1
  9. data/bin/glimmer-setup +58 -0
  10. data/bin/glimmer_runner.rb +4 -0
  11. data/docs/reference/GLIMMER_COMMAND.md +19 -30
  12. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +39 -10
  13. data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +7 -1
  14. data/docs/reference/GLIMMER_SAMPLES.md +27 -0
  15. data/glimmer-dsl-swt.gemspec +0 -0
  16. data/lib/glimmer-dsl-swt.rb +8 -0
  17. data/lib/glimmer/data_binding/shine.rb +41 -26
  18. data/lib/glimmer/data_binding/widget_binding.rb +1 -1
  19. data/lib/glimmer/dsl/swt/c_tab_item_expression.rb +58 -0
  20. data/lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb +2 -1
  21. data/lib/glimmer/dsl/swt/dsl.rb +2 -1
  22. data/lib/glimmer/dsl/swt/shine_data_binding_expression.rb +49 -0
  23. data/lib/glimmer/dsl/swt/tab_item_expression.rb +7 -3
  24. data/lib/glimmer/dsl/swt/widget_expression.rb +1 -1
  25. data/lib/glimmer/launcher.rb +33 -51
  26. data/lib/glimmer/rake_task.rb +1 -1
  27. data/lib/glimmer/rake_task/package.rb +7 -2
  28. data/lib/glimmer/rake_task/scaffold.rb +227 -254
  29. data/lib/glimmer/swt/c_tab_item_proxy.rb +53 -0
  30. data/lib/glimmer/swt/custom/code_text.rb +17 -9
  31. data/lib/glimmer/swt/custom/shape.rb +15 -1
  32. data/lib/glimmer/swt/sash_form_proxy.rb +6 -0
  33. data/lib/glimmer/swt/shell_proxy.rb +3 -1
  34. data/lib/glimmer/swt/tab_folder_proxy.rb +1 -0
  35. data/lib/glimmer/swt/tab_item_proxy.rb +17 -18
  36. data/lib/glimmer/swt/widget_proxy.rb +9 -0
  37. data/samples/elaborate/contact_manager.rb +7 -5
  38. data/samples/elaborate/login.rb +7 -7
  39. data/samples/elaborate/mandelbrot_fractal.rb +13 -8
  40. data/samples/elaborate/meta_sample.rb +4 -2
  41. data/samples/elaborate/metronome.rb +4 -4
  42. data/samples/elaborate/stock_ticker.rb +2 -2
  43. data/samples/elaborate/tic_tac_toe.rb +2 -2
  44. data/samples/hello/hello_button.rb +1 -1
  45. data/samples/hello/hello_c_combo.rb +69 -0
  46. data/samples/hello/hello_c_tab.rb +174 -0
  47. data/samples/hello/hello_c_tab/denmark.png +0 -0
  48. data/samples/hello/hello_c_tab/finland.png +0 -0
  49. data/samples/hello/hello_c_tab/france.png +0 -0
  50. data/samples/hello/hello_c_tab/germany.png +0 -0
  51. data/samples/hello/hello_c_tab/italy.png +0 -0
  52. data/samples/hello/hello_c_tab/mexico.png +0 -0
  53. data/samples/hello/hello_c_tab/netherlands.png +0 -0
  54. data/samples/hello/hello_c_tab/norway.png +0 -0
  55. data/samples/hello/hello_c_tab/usa.png +0 -0
  56. data/samples/hello/hello_canvas.rb +5 -5
  57. data/samples/hello/hello_canvas_animation_data_binding.rb +1 -1
  58. data/samples/hello/hello_canvas_data_binding.rb +16 -16
  59. data/samples/hello/hello_checkbox.rb +4 -4
  60. data/samples/hello/hello_code_text.rb +3 -57
  61. data/samples/hello/hello_color_dialog.rb +1 -1
  62. data/samples/hello/hello_combo.rb +1 -1
  63. data/samples/hello/hello_computed.rb +5 -5
  64. data/samples/hello/hello_custom_widget.rb +1 -1
  65. data/samples/hello/hello_date_time.rb +4 -4
  66. data/samples/hello/hello_dialog.rb +3 -2
  67. data/samples/hello/hello_drag_and_drop.rb +1 -1
  68. data/samples/hello/hello_file_dialog.rb +1 -1
  69. data/samples/hello/hello_font_dialog.rb +3 -3
  70. data/samples/hello/hello_group.rb +6 -6
  71. data/samples/hello/hello_link.rb +56 -50
  72. data/samples/hello/hello_list_multi_selection.rb +1 -1
  73. data/samples/hello/hello_list_single_selection.rb +1 -1
  74. data/samples/hello/hello_progress_bar.rb +10 -10
  75. data/samples/hello/hello_radio.rb +6 -6
  76. data/samples/hello/hello_sash_form.rb +4 -4
  77. data/samples/hello/hello_shape.rb +1 -0
  78. data/samples/hello/hello_spinner.rb +6 -2
  79. data/samples/hello/hello_styled_text.rb +11 -11
  80. data/samples/hello/hello_tab.rb +2 -0
  81. data/vendor/swt/linux/swt.jar +0 -0
  82. data/vendor/swt/linux_aarch64/swt.jar +0 -0
  83. data/vendor/swt/mac/swt.jar +0 -0
  84. data/vendor/swt/mac_aarch64/swt.jar +0 -0
  85. data/vendor/swt/windows/swt.jar +0 -0
  86. metadata +76 -32
@@ -268,8 +268,10 @@ class MetaSampleApplication
268
268
  root {
269
269
  grid_layout(2, false) {
270
270
  horizontal_spacing 0
271
- margin_width 0
272
- margin_height 0
271
+ margin_left 0
272
+ margin_right 0
273
+ margin_top 0
274
+ margin_bottom 0
273
275
  }
274
276
  }
275
277
  line_numbers {
@@ -69,7 +69,7 @@ class Metronome
69
69
  }
70
70
 
71
71
  body {
72
- shell {
72
+ shell(:no_resize) {
73
73
  row_layout(:vertical) {
74
74
  center true
75
75
  }
@@ -83,7 +83,7 @@ class Metronome
83
83
  spinner {
84
84
  minimum 1
85
85
  maximum 64
86
- selection bind(self, 'rhythm.beat_count', after_write: ->(v) {restart_metronome})
86
+ selection <=> [self, 'rhythm.beat_count', after_write: ->(v) {restart_metronome}]
87
87
  font height: 30
88
88
  }
89
89
 
@@ -95,7 +95,7 @@ class Metronome
95
95
  spinner {
96
96
  minimum 30
97
97
  maximum 1000
98
- selection bind(self, 'rhythm.bpm')
98
+ selection <=> [self, 'rhythm.bpm']
99
99
  font height: 30
100
100
  }
101
101
 
@@ -122,7 +122,7 @@ class Metronome
122
122
  height_hint 50
123
123
  }
124
124
  rectangle(0, 0, :default, :default, 36, 36) {
125
- background bind(self, "rhythm.beats[#{n}].on") {|on| on ? :red : :yellow}
125
+ background <= [self, "rhythm.beats[#{n}].on", on_read: ->(on) { on ? :red : :yellow}]
126
126
  }
127
127
  }
128
128
  }
@@ -110,13 +110,13 @@ class StockTicker
110
110
  tab[:canvas].set_size(new_x_location, @tabs.first[:canvas].bounds.height)
111
111
  tab[:canvas].cursor = :hand
112
112
  tab[:scrolled_composite].set_min_size(new_x_location, @tabs.first[:canvas].bounds.height)
113
- tab[:scrolled_composite].set_origin(tab[:scrolled_composite].origin.x + 1, tab[:scrolled_composite].origin.y) if (tab[:scrolled_composite].origin.x + tab[:scrolled_composite].client_area.width) == canvas_width
113
+ tab[:scrolled_composite].set_origin(tab[:scrolled_composite].origin.x + 1, tab[:scrolled_composite].origin.y) if (tab[:scrolled_composite].origin.x + tab[:scrolled_composite].client_area.width + (OS.mac? ? 0 : 20)) == canvas_width
114
114
  end
115
115
  else
116
116
  tab[:canvas_header].content {
117
117
  text(stock.name, 15, new_y - 10) {
118
118
  foreground @stock_colors[stock_index]
119
- font height: 14
119
+ font height: 13
120
120
  }
121
121
  }
122
122
  end
@@ -47,8 +47,8 @@ class TicTacToe
47
47
  (1..3).each { |column|
48
48
  button {
49
49
  layout_data :fill, :fill, true, true
50
- text bind(@tic_tac_toe_board[row, column], :sign)
51
- enabled bind(@tic_tac_toe_board[row, column], :empty)
50
+ text <= [@tic_tac_toe_board[row, column], :sign]
51
+ enabled <= [@tic_tac_toe_board[row, column], :empty]
52
52
  font style: :bold, height: 20
53
53
  on_widget_selected {
54
54
  @tic_tac_toe_board.mark(row, column)
@@ -35,7 +35,7 @@ class HelloButton
35
35
  text 'Hello, Button!'
36
36
 
37
37
  button {
38
- text bind(self, :count) {|value| "Click To Increment: #{value} "}
38
+ text <= [self, :count, on_read: ->(value) { "Click To Increment: #{value} " }]
39
39
 
40
40
  on_widget_selected {
41
41
  self.count += 1
@@ -0,0 +1,69 @@
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer-dsl-swt'
23
+
24
+ # This is a sample for the c_combo widget, a more customizable version of combo
25
+ class HelloCCombo
26
+ class Person
27
+ attr_accessor :country, :country_options
28
+
29
+ def initialize
30
+ self.country_options = ['', 'Canada', 'US', 'Mexico']
31
+ reset_country!
32
+ end
33
+
34
+ def reset_country!
35
+ self.country = 'Canada'
36
+ end
37
+ end
38
+
39
+ include Glimmer::UI::CustomShell
40
+
41
+ before_body {
42
+ @person = Person.new
43
+ }
44
+
45
+ body {
46
+ shell {
47
+ row_layout(:vertical) {
48
+ fill true
49
+ }
50
+
51
+ text 'Hello, C Combo!'
52
+
53
+ c_combo(:read_only) {
54
+ selection <=> [@person, :country] # also binds to country_options by convention
55
+ font height: 45 # unlike `combo`, `c_combo` changes height when setting the font height
56
+ }
57
+
58
+ button {
59
+ text 'Reset Selection'
60
+
61
+ on_widget_selected do
62
+ @person.reset_country!
63
+ end
64
+ }
65
+ }
66
+ }
67
+ end
68
+
69
+ HelloCCombo.launch
@@ -0,0 +1,174 @@
1
+ # Copyright (c) 2007-2021 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ # Country flag images were made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](http://www.flaticon.com)
23
+
24
+ require 'glimmer-dsl-swt'
25
+
26
+ # This is a sample for the Custom Tab widgets (c_tab_folder & c_tab_item), which are more customizable versions of tab_folder and tab_item.
27
+ class HelloCTab
28
+ include Glimmer::UI::CustomShell
29
+
30
+ body {
31
+ shell {
32
+ row_layout
33
+ text 'Hello, C Tab!'
34
+ minimum_size 200, 200
35
+
36
+ c_tab_folder { # accepts styles: :close, :top, :bottom, :flat, :border, :single, :multi
37
+ layout_data {
38
+ width 1024
39
+ height 200
40
+ }
41
+ c_tab_item(:close) {
42
+ text 'English'
43
+ tool_tip_text 'English Greeting'
44
+ foreground :blue
45
+ selection_foreground :dark_blue
46
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
47
+ image File.expand_path('hello_c_tab/usa.png', __dir__)
48
+
49
+ label {
50
+ text 'Hello, World!'
51
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
52
+ }
53
+ }
54
+
55
+ c_tab_item(:close) {
56
+ text 'French'
57
+ tool_tip_text 'French Greeting'
58
+ foreground :blue
59
+ selection_foreground :dark_blue
60
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
61
+ image File.expand_path('hello_c_tab/france.png', __dir__)
62
+
63
+ label {
64
+ text 'Bonjour, Univers!'
65
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
66
+ }
67
+ }
68
+
69
+ c_tab_item(:close) {
70
+ text 'Spanish'
71
+ tool_tip_text 'Spanish Greeting'
72
+ foreground :blue
73
+ selection_foreground :dark_blue
74
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
75
+ image File.expand_path('hello_c_tab/mexico.png', __dir__)
76
+
77
+ label {
78
+ text 'Hola, Mundo!'
79
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
80
+ }
81
+ }
82
+
83
+ c_tab_item(:close) {
84
+ text 'German'
85
+ tool_tip_text 'German Greeting'
86
+ foreground :blue
87
+ selection_foreground :dark_blue
88
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
89
+ image File.expand_path('hello_c_tab/germany.png', __dir__)
90
+
91
+ label {
92
+ text 'Hallo, Welt!'
93
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
94
+ }
95
+ }
96
+
97
+ c_tab_item(:close) {
98
+ text 'Italian'
99
+ tool_tip_text 'Italian Greeting'
100
+ foreground :blue
101
+ selection_foreground :dark_blue
102
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
103
+ image File.expand_path('hello_c_tab/italy.png', __dir__)
104
+
105
+ label {
106
+ text 'Ciao, Mondo!'
107
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
108
+ }
109
+ }
110
+
111
+ c_tab_item(:close) {
112
+ text 'Dutch'
113
+ tool_tip_text 'Dutch Greeting'
114
+ foreground :blue
115
+ selection_foreground :dark_blue
116
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
117
+ image File.expand_path('hello_c_tab/netherlands.png', __dir__)
118
+
119
+ label {
120
+ text 'Hallo, Wereld!'
121
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
122
+ }
123
+ }
124
+
125
+ c_tab_item(:close) {
126
+ text 'Danish'
127
+ tool_tip_text 'Danish Greeting'
128
+ foreground :blue
129
+ selection_foreground :dark_blue
130
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
131
+ image File.expand_path('hello_c_tab/denmark.png', __dir__)
132
+
133
+ label {
134
+ text 'Hej, Verden!'
135
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
136
+ }
137
+ }
138
+
139
+ c_tab_item(:close) {
140
+ text 'Finnish'
141
+ tool_tip_text 'Finnish Greeting'
142
+ foreground :blue
143
+ selection_foreground :dark_blue
144
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
145
+ image File.expand_path('hello_c_tab/finland.png', __dir__)
146
+
147
+ label {
148
+ text 'Hei, Maailma!'
149
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
150
+ }
151
+ }
152
+
153
+ c_tab_item(:close) {
154
+ text 'Norwegian'
155
+ tool_tip_text 'Norwegian Greeting'
156
+ foreground :blue
157
+ selection_foreground :dark_blue
158
+ font name: 'Times New Roman', height: 30, style: [:bold, :italic]
159
+ image File.expand_path('hello_c_tab/norway.png', __dir__)
160
+
161
+ label {
162
+ text 'Hei, Verden!'
163
+ font name: 'Times New Roman', height: 90, style: [:bold, :italic]
164
+ }
165
+ }
166
+
167
+ }
168
+
169
+ }
170
+
171
+ }
172
+ end
173
+
174
+ HelloCTab.launch
Binary file
Binary file
@@ -59,7 +59,7 @@ class HelloCanvas
59
59
  rectangle([:default, -70], :default, :default, [:default, 1]) {
60
60
  foreground :cyan
61
61
  text {
62
- string bind(self, :artist)
62
+ string <=> [self, :artist]
63
63
  x :default, 1 # add 1 pixel to default x (shape centered within parent horizontally)
64
64
  y :default, 1 # add 1 pixel to default y (shape centered within parent vertically)
65
65
  background :yellow
@@ -105,7 +105,7 @@ class HelloCanvas
105
105
  menu {
106
106
  menu_item {
107
107
  text 'Change Background Color...'
108
- enabled bind(self, :selected_shape) {|shape| shape.respond_to?(:background) && shape.background }
108
+ enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background) && shape.background }]
109
109
  on_widget_selected {
110
110
  @selected_shape&.background = color_dialog.open
111
111
  self.selected_shape = nil
@@ -113,7 +113,7 @@ class HelloCanvas
113
113
  }
114
114
  menu_item {
115
115
  text 'Change Background Pattern Color 1...'
116
- enabled bind(self, :selected_shape) {|shape| shape.respond_to?(:background_pattern) && shape.background_pattern }
116
+ enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background_pattern) && shape.background_pattern }]
117
117
  on_widget_selected {
118
118
  if @selected_shape
119
119
  background_pattern_args = @selected_shape.background_pattern_args
@@ -125,7 +125,7 @@ class HelloCanvas
125
125
  }
126
126
  menu_item {
127
127
  text 'Change Background Pattern Color 2...'
128
- enabled bind(self, :selected_shape) {|shape| shape.respond_to?(:background_pattern) && shape.background_pattern }
128
+ enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background_pattern) && shape.background_pattern }]
129
129
  on_widget_selected {
130
130
  if @selected_shape
131
131
  background_pattern_args = @selected_shape.background_pattern_args
@@ -138,7 +138,7 @@ class HelloCanvas
138
138
  menu_item(:separator)
139
139
  menu_item {
140
140
  text 'Change Foreground Color...'
141
- enabled bind(self, :selected_shape) {|shape| shape.respond_to?(:foreground) && shape.foreground }
141
+ enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:foreground) && shape.foreground }]
142
142
  on_widget_selected {
143
143
  @selected_shape&.foreground = color_dialog.open
144
144
  self.selected_shape = nil
@@ -46,7 +46,7 @@ class HelloAnimationDataBinding
46
46
  digits 3
47
47
  minimum 1
48
48
  maximum 100
49
- selection bind(self, :delay_time, on_read: ->(v) {(BigDecimal(v.to_s)*1000).to_f}, on_write: ->(v) {(BigDecimal(v.to_s)/1000).to_f})
49
+ selection <=> [self, :delay_time, on_read: ->(v) {(BigDecimal(v.to_s)*1000).to_f}, on_write: ->(v) {(BigDecimal(v.to_s)/1000).to_f}]
50
50
  }
51
51
  animation {
52
52
  every bind(self, :delay_time)
@@ -81,7 +81,7 @@ class HelloCanvasDataBinding
81
81
  }
82
82
  maximum CANVAS_WIDTH
83
83
  increment 3
84
- selection bind(self, :x1_value)
84
+ selection <=> [self, :x1_value]
85
85
  }
86
86
  spinner {
87
87
  layout_data(:fill, :center, false, false) {
@@ -89,7 +89,7 @@ class HelloCanvasDataBinding
89
89
  }
90
90
  maximum CANVAS_HEIGHT
91
91
  increment 3
92
- selection bind(self, :y1_value)
92
+ selection <=> [self, :y1_value]
93
93
  }
94
94
  label {
95
95
  layout_data(:fill, :center, false, false) {
@@ -109,7 +109,7 @@ class HelloCanvasDataBinding
109
109
  }
110
110
  maximum CANVAS_WIDTH
111
111
  increment 3
112
- selection bind(self, :x2_value)
112
+ selection <=> [self, :x2_value]
113
113
  }
114
114
  spinner {
115
115
  layout_data(:fill, :center, false, false) {
@@ -117,7 +117,7 @@ class HelloCanvasDataBinding
117
117
  }
118
118
  maximum CANVAS_HEIGHT
119
119
  increment 3
120
- selection bind(self, :y2_value)
120
+ selection <=> [self, :y2_value]
121
121
  }
122
122
  label {
123
123
  layout_data(:fill, :center, false, false) {
@@ -143,7 +143,7 @@ class HelloCanvasDataBinding
143
143
  }
144
144
  maximum 255
145
145
  increment 10
146
- selection bind(self, :foreground_red)
146
+ selection <=> [self, :foreground_red]
147
147
  }
148
148
  spinner {
149
149
  layout_data(:fill, :center, false, false) {
@@ -151,7 +151,7 @@ class HelloCanvasDataBinding
151
151
  }
152
152
  maximum 255
153
153
  increment 10
154
- selection bind(self, :foreground_green)
154
+ selection <=> [self, :foreground_green]
155
155
  }
156
156
  spinner {
157
157
  layout_data(:fill, :center, false, false) {
@@ -159,7 +159,7 @@ class HelloCanvasDataBinding
159
159
  }
160
160
  maximum 255
161
161
  increment 10
162
- selection bind(self, :foreground_blue)
162
+ selection <=> [self, :foreground_blue]
163
163
  }
164
164
  label {
165
165
  layout_data(:fill, :center, false, false) {
@@ -178,13 +178,13 @@ class HelloCanvasDataBinding
178
178
  horizontal_span 3
179
179
  }
180
180
  maximum 255
181
- selection bind(self, :line_width_value)
181
+ selection <=> [self, :line_width_value]
182
182
  }
183
183
  combo(:read_only) {
184
184
  layout_data(:fill, :center, false, false) {
185
185
  horizontal_span 3
186
186
  }
187
- selection bind(self, :line_style_value)
187
+ selection <=> [self, :line_style_value]
188
188
  }
189
189
  canvas {
190
190
  layout_data(:center, :center, false, false) {
@@ -195,13 +195,13 @@ class HelloCanvasDataBinding
195
195
  background :white
196
196
 
197
197
  line {
198
- x1 bind(self, :x1_value)
199
- y1 bind(self, :y1_value)
200
- x2 bind(self, :x2_value)
201
- y2 bind(self, :y2_value)
202
- foreground bind(self, :foreground_value, computed_by: [:foreground_red, :foreground_green, :foreground_blue])
203
- line_width bind(self, :line_width_value)
204
- line_style bind(self, :line_style_value)
198
+ x1 <=> [self, :x1_value]
199
+ y1 <=> [self, :y1_value]
200
+ x2 <=> [self, :x2_value]
201
+ y2 <=> [self, :y2_value]
202
+ foreground <=> [self, :foreground_value, computed_by: [:foreground_red, :foreground_green, :foreground_blue]]
203
+ line_width <=> [self, :line_width_value]
204
+ line_style <=> [self, :line_style_value]
205
205
  }
206
206
  }
207
207
  }