glimmer-dsl-fx 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +8 -8
- data/VERSION +1 -1
- data/glimmer-dsl-fx.gemspec +0 -0
- data/lib/glimmer/fx/control_proxy.rb +9 -4
- data/samples/hello/hello_button.rb +1 -1
- data/samples/hello/hello_world.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02d5c6e11384d865fe3ffe75c3512baf4f2c2e6f1f3afef8baeeaca78f72adc3
|
4
|
+
data.tar.gz: f377b9dbad1d072137d044dacbaf63165e535cf2fb8c73181e605ad2903b4554
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c5f94b545c2d96abe68eb174144f8eec6e6da913a5c740547c1985a32ad69d34cfa20a7a2546bda9f1389a65c46838196872a1f36ec9948dbe4f0dc3ec727f
|
7
|
+
data.tar.gz: 7fa321097ec377f657cfc833e1be1191f0b7a3786411e9a87c70cc169588c9b16e59b9f66f9f3b0c2357dd347ed11c0fd5fd613d507732b8e9460b5b16588260
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for FX 0.0.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for FX 0.0.2
|
2
2
|
## FOX Toolkit Ruby Desktop Development GUI Library
|
3
3
|
[](http://badge.fury.io/rb/glimmer-dsl-fx)
|
4
4
|
[](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
@@ -21,7 +21,7 @@ Hello, World!
|
|
21
21
|
```ruby
|
22
22
|
app('HelloWorld', 'Glimmer') {
|
23
23
|
main_window('Hello, World!') {
|
24
|
-
label('Hello, World!')
|
24
|
+
label('Hello, World!', opts: [:layout_center_x, :layout_center_y])
|
25
25
|
}
|
26
26
|
}.run
|
27
27
|
```
|
@@ -76,7 +76,7 @@ gem install glimmer-dsl-fx
|
|
76
76
|
|
77
77
|
Add the following to `Gemfile`:
|
78
78
|
```
|
79
|
-
gem 'glimmer-dsl-fx', '~> 0.0.
|
79
|
+
gem 'glimmer-dsl-fx', '~> 0.0.2'
|
80
80
|
```
|
81
81
|
|
82
82
|
And, then run:
|
@@ -91,7 +91,7 @@ Require the library and mixin the `Glimmer` module to utilize the Glimmer GUI DS
|
|
91
91
|
```ruby
|
92
92
|
app('HelloWorld', 'Glimmer') {
|
93
93
|
main_window('Hello, World!') {
|
94
|
-
label('Hello, World!')
|
94
|
+
label('Hello, World!', opts: [:layout_center_x, :layout_center_y])
|
95
95
|
}
|
96
96
|
}.run
|
97
97
|
```
|
@@ -107,7 +107,7 @@ class SomeGlimmerApplication
|
|
107
107
|
def launch
|
108
108
|
app('HelloWorld', 'Glimmer') {
|
109
109
|
main_window('Hello, World!') {
|
110
|
-
label('Hello, World!')
|
110
|
+
label('Hello, World!', opts: [:layout_center_x, :layout_center_y])
|
111
111
|
}
|
112
112
|
}.run
|
113
113
|
end
|
@@ -256,7 +256,7 @@ class HelloButton
|
|
256
256
|
def launch
|
257
257
|
app('HelloButton', 'Glimmer') {
|
258
258
|
main_window('Hello, Button!') {
|
259
|
-
@button = button('Click To Increment: 0') {
|
259
|
+
@button = button('Click To Increment: 0', opts: [:frame_raised, :frame_thick, :layout_center_x, :layout_center_y]) {
|
260
260
|
on(:command) do
|
261
261
|
@counter.count += 1
|
262
262
|
end
|
@@ -289,7 +289,7 @@ girb
|
|
289
289
|
|
290
290
|
This gives you `irb` with the `glimmer-dsl-fx` gem loaded and the `Glimmer` module mixed into the main object for easy experimentation with GUI.
|
291
291
|
|
292
|
-
Note: GIRB for Glimmer DSL for FX 0.0.
|
292
|
+
Note: GIRB for Glimmer DSL for FX 0.0.2 is still very rudimentary and does not support entering code for multiple applications, yet only one. You would have to exit and re-enter after each application entered.
|
293
293
|
|
294
294
|
Gotcha: On the Mac, when you close a window opened in `girb`, it remains open until you enter `exit`.
|
295
295
|
|
@@ -364,7 +364,7 @@ class HelloButton
|
|
364
364
|
def launch
|
365
365
|
app('HelloButton', 'Glimmer') {
|
366
366
|
main_window('Hello, Button!') {
|
367
|
-
@button = button("Click To Increment: 0") {
|
367
|
+
@button = button("Click To Increment: 0", opts: [:frame_raised, :frame_thick, :layout_center_x, :layout_center_y]) {
|
368
368
|
on(:command) do
|
369
369
|
@count += 1
|
370
370
|
@button.text = "Click To Increment: #{@count}"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/glimmer-dsl-fx.gemspec
CHANGED
Binary file
|
@@ -165,9 +165,7 @@ module Glimmer
|
|
165
165
|
|
166
166
|
def window_proxy
|
167
167
|
found_proxy = self
|
168
|
-
until found_proxy.nil? || found_proxy.is_a?(WindowProxy)
|
169
|
-
found_proxy = found_proxy.parent_proxy
|
170
|
-
end
|
168
|
+
found_proxy = found_proxy.parent_proxy until found_proxy.nil? || found_proxy.is_a?(WindowProxy)
|
171
169
|
found_proxy
|
172
170
|
end
|
173
171
|
|
@@ -208,9 +206,16 @@ module Glimmer
|
|
208
206
|
end
|
209
207
|
|
210
208
|
def normalize_args(args)
|
211
|
-
args.map do |arg|
|
209
|
+
result_args = args.map do |arg|
|
212
210
|
arg.is_a?(ControlProxy) ? arg.fx : arg
|
213
211
|
end
|
212
|
+
kwargs = result_args.last.is_a?(Hash) ? result_args.pop : {}
|
213
|
+
opts = [kwargs.delete(:opts) || kwargs.delete('opts')].flatten.compact
|
214
|
+
opts_value = opts.map do |opt|
|
215
|
+
::Fox.const_get(opt.upcase.to_sym)
|
216
|
+
end.reduce(:|)
|
217
|
+
kwargs = kwargs.merge(opts: opts_value) unless opts.empty?
|
218
|
+
kwargs.empty? ? result_args : result_args + [kwargs]
|
214
219
|
end
|
215
220
|
end
|
216
221
|
end
|
@@ -10,7 +10,7 @@ class HelloButton
|
|
10
10
|
def launch
|
11
11
|
app('HelloButton', 'Glimmer') {
|
12
12
|
main_window('Hello, Button!') {
|
13
|
-
@button = button("Click To Increment: 0") {
|
13
|
+
@button = button("Click To Increment: 0", opts: [:frame_raised, :frame_thick, :layout_center_x, :layout_center_y]) {
|
14
14
|
on(:command) do
|
15
15
|
@count += 1
|
16
16
|
@button.text = "Click To Increment: #{@count}"
|