glimmer-dsl-tk 0.0.8 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +21 -20
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/girb_runner.rb +21 -0
- data/glimmer-dsl-tk.gemspec +0 -0
- data/lib/glimmer/dsl/tk/dsl.rb +1 -0
- data/lib/glimmer/dsl/tk/shine_data_binding_expression.rb +43 -0
- data/lib/glimmer/dsl/tk/widget_expression.rb +1 -0
- data/lib/glimmer/tk/root_proxy.rb +1 -1
- data/lib/glimmer/tk/treeview_proxy.rb +50 -0
- data/lib/glimmer/tk/widget_proxy.rb +17 -16
- data/samples/hello/hello_combo.rb +1 -1
- data/samples/hello/hello_computed.rb +5 -5
- data/samples/hello/hello_list_multi_selection.rb +1 -1
- data/samples/hello/hello_list_single_selection.rb +1 -1
- metadata +22 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17b887519b4dcbc1d9730240835fa918d81902268ea4c8607a2528696b6c5fd
|
4
|
+
data.tar.gz: df8da719382108710096f6026e362c32fff92fb15b720ba43bceb5d12b688f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7384362360e983fd820843b0c9ceccad79a39e96a152aea42ae414327b2b4665c8b2af1470a7ee5da69695968daec98fb7b52c34d68b732934b3efeb59f0073
|
7
|
+
data.tar.gz: c809eecf36d5c60e81ade4beb39ed52260cd1b0e1fb9a8ee6ac97fd7d9bc68e315d17fd2e49fad6eb39e452fefe1551d627fa2381ac3b1594d3cdbe0efa8905c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.0.12
|
4
|
+
|
5
|
+
- Upgrade to glimmer 2.3.0
|
6
|
+
- Support Shine syntax for data-binding
|
7
|
+
- Update all data-binding samples to use Shine syntax for data-binding
|
8
|
+
|
9
|
+
## 0.0.11
|
10
|
+
|
11
|
+
- Add preliminary support for `treeview` (no data-binding) with `columns`, `show`, and `heading_configure` attributes/methods
|
12
|
+
|
13
|
+
## 0.0.10
|
14
|
+
|
15
|
+
- puts_debuggerer gem to help consumers with debugging in and out of girb
|
16
|
+
|
17
|
+
## 0.0.9
|
18
|
+
|
19
|
+
- Upgrade to glimmer 2.1.2
|
20
|
+
|
3
21
|
## 0.0.8
|
4
22
|
|
5
23
|
- Fix issue #5 (https://github.com/AndyObtiva/glimmer-dsl-tk/issues/5)
|
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 Tk 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 Tk 0.0.12
|
2
2
|
## MRI Ruby Desktop Development GUI Library
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-tk.svg)](http://badge.fury.io/rb/glimmer-dsl-tk)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-tk/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-tk?branch=master)
|
@@ -15,7 +15,7 @@ Additionally, [Ruby](https://www.ruby-lang.org/en/) 3.0 Ractor (formerly known a
|
|
15
15
|
|
16
16
|
The trade-off is that while [SWT](https://www.eclipse.org/swt/) provides a plethora of high quality reusable widgets for the Enterprise (such as [Nebula](https://www.eclipse.org/nebula/)), [Tk](https://www.tcl.tk/) enables very fast app startup time and a small memory footprint via [MRI Ruby](https://www.ruby-lang.org/en/).
|
17
17
|
|
18
|
-
[Glimmer](https://github.com/AndyObtiva/glimmer) aims to provide a DSL similar to the [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) to enable more productive desktop development in Ruby with:
|
18
|
+
[Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk) aims to provide a DSL similar to the [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) to enable more productive desktop development in Ruby with:
|
19
19
|
- Declarative DSL syntax that visually maps to the GUI widget hierarchy
|
20
20
|
- Convention over configuration via smart defaults and automation of low-level details
|
21
21
|
- Requiring the least amount of syntax possible to build GUI
|
@@ -46,10 +46,11 @@ Glimmer app:
|
|
46
46
|
|
47
47
|
![glimmer dsl tk screenshot sample hello world](images/glimmer-dsl-tk-screenshot-sample-hello-world.png)
|
48
48
|
|
49
|
-
NOTE: Glimmer DSL for Tk is in alpha mode. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.
|
49
|
+
NOTE: Glimmer DSL for Tk is currently in early alpha mode (incomplete). Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.
|
50
50
|
|
51
51
|
Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
52
52
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
53
|
+
- [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
|
53
54
|
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
54
55
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
55
56
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS (Cascading Style Sheets)
|
@@ -80,7 +81,7 @@ gem install glimmer-dsl-tk
|
|
80
81
|
|
81
82
|
Add the following to `Gemfile`:
|
82
83
|
```
|
83
|
-
gem 'glimmer-dsl-tk', '~> 0.0.
|
84
|
+
gem 'glimmer-dsl-tk', '~> 0.0.12'
|
84
85
|
```
|
85
86
|
|
86
87
|
And, then run:
|
@@ -210,7 +211,7 @@ Example:
|
|
210
211
|
entry {
|
211
212
|
grid column: 1, row: 2
|
212
213
|
width 15
|
213
|
-
text
|
214
|
+
text <=> [@contact, :year_of_birth]
|
214
215
|
}
|
215
216
|
```
|
216
217
|
|
@@ -218,7 +219,7 @@ More details can be found in the [Hello, Computed!](#hello-computed) sample belo
|
|
218
219
|
|
219
220
|
## Bidirectional Data-Binding
|
220
221
|
|
221
|
-
Glimmer supports bidirectional data-binding via the
|
222
|
+
Glimmer supports Shine syntax bidirectional data-binding via the `<=>` operator (read-write) and unidirectional data-binding via the `<=` operator (read-only), which takes a model and an attribute (the `bind` keyword may also be used as the old-style of data-binding).
|
222
223
|
|
223
224
|
### Combo Data-Binding
|
224
225
|
|
@@ -229,7 +230,7 @@ This assumes a `Person` model with a `country` attribute representing their curr
|
|
229
230
|
```ruby
|
230
231
|
combobox {
|
231
232
|
state 'readonly'
|
232
|
-
text
|
233
|
+
text <=> [person, :country]
|
233
234
|
}
|
234
235
|
```
|
235
236
|
|
@@ -251,7 +252,7 @@ This assumes a `Person` model with a `country` attribute representing their curr
|
|
251
252
|
```ruby
|
252
253
|
list {
|
253
254
|
selectmode 'browse'
|
254
|
-
text
|
255
|
+
text <=> [person, :country]
|
255
256
|
}
|
256
257
|
```
|
257
258
|
|
@@ -272,7 +273,7 @@ This assumes a `Person` model with a `provinces` attribute representing their cu
|
|
272
273
|
|
273
274
|
```ruby
|
274
275
|
list {
|
275
|
-
text
|
276
|
+
text <=> [person, :provinces]
|
276
277
|
}
|
277
278
|
```
|
278
279
|
|
@@ -291,7 +292,7 @@ This assumes a `Person` model with a `country` attribute.
|
|
291
292
|
|
292
293
|
```ruby
|
293
294
|
label {
|
294
|
-
text
|
295
|
+
text <=> [person, :country]
|
295
296
|
}
|
296
297
|
```
|
297
298
|
|
@@ -309,7 +310,7 @@ This assumes a `Person` model with a `country` attribute.
|
|
309
310
|
|
310
311
|
```ruby
|
311
312
|
entry {
|
312
|
-
text
|
313
|
+
text <=> [person, :country]
|
313
314
|
}
|
314
315
|
```
|
315
316
|
|
@@ -424,7 +425,7 @@ root {
|
|
424
425
|
|
425
426
|
combobox { |proxy|
|
426
427
|
state 'readonly'
|
427
|
-
text
|
428
|
+
text <=> [person, :country]
|
428
429
|
}
|
429
430
|
|
430
431
|
button { |proxy|
|
@@ -465,7 +466,7 @@ root {
|
|
465
466
|
|
466
467
|
list {
|
467
468
|
selectmode 'browse'
|
468
|
-
selection
|
469
|
+
selection <=> [person, :country]
|
469
470
|
}
|
470
471
|
|
471
472
|
button {
|
@@ -503,7 +504,7 @@ root {
|
|
503
504
|
title 'Hello, List Multi Selection!'
|
504
505
|
|
505
506
|
list {
|
506
|
-
selection
|
507
|
+
selection <=> [person, :provinces]
|
507
508
|
}
|
508
509
|
|
509
510
|
button {
|
@@ -550,7 +551,7 @@ Glimmer code (from [samples/hello/hello_computed.rb](samples/hello/hello_compute
|
|
550
551
|
entry {
|
551
552
|
grid column: 1, row: 0
|
552
553
|
width 15
|
553
|
-
text
|
554
|
+
text <=> [@contact, :first_name]
|
554
555
|
}
|
555
556
|
|
556
557
|
label {
|
@@ -560,7 +561,7 @@ Glimmer code (from [samples/hello/hello_computed.rb](samples/hello/hello_compute
|
|
560
561
|
entry {
|
561
562
|
grid column: 1, row: 1
|
562
563
|
width 15
|
563
|
-
text
|
564
|
+
text <=> [@contact, :last_name]
|
564
565
|
}
|
565
566
|
|
566
567
|
label {
|
@@ -570,7 +571,7 @@ Glimmer code (from [samples/hello/hello_computed.rb](samples/hello/hello_compute
|
|
570
571
|
entry {
|
571
572
|
grid column: 1, row: 2
|
572
573
|
width 15
|
573
|
-
text
|
574
|
+
text <=> [@contact, :year_of_birth]
|
574
575
|
}
|
575
576
|
|
576
577
|
label {
|
@@ -579,7 +580,7 @@ Glimmer code (from [samples/hello/hello_computed.rb](samples/hello/hello_compute
|
|
579
580
|
}
|
580
581
|
label {
|
581
582
|
grid column: 1, row: 3, sticky: 'w'
|
582
|
-
text
|
583
|
+
text <=> [@contact, :name, computed_by: [:first_name, :last_name]]
|
583
584
|
}
|
584
585
|
|
585
586
|
label {
|
@@ -588,7 +589,7 @@ Glimmer code (from [samples/hello/hello_computed.rb](samples/hello/hello_compute
|
|
588
589
|
}
|
589
590
|
label {
|
590
591
|
grid column: 1, row: 4, sticky: 'w'
|
591
|
-
text
|
592
|
+
text <=> [@contact, :age, on_write: :to_i, computed_by: [:year_of_birth]]
|
592
593
|
}
|
593
594
|
}
|
594
595
|
}.open
|
@@ -629,7 +630,7 @@ If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/g
|
|
629
630
|
|
630
631
|
## Planned Features and Feature Suggestions
|
631
632
|
|
632
|
-
These features have been planned or suggested. You might see them in a future version of Glimmer DSL for Tk. You are welcome to contribute more feature suggestions.
|
633
|
+
These features have been planned or suggested. You might see them in a future version of [Glimmer DSL for Tk](https://rubygems.org/gems/glimmer-dsl-tk). You are welcome to contribute more feature suggestions.
|
633
634
|
|
634
635
|
[TODO.md](TODO.md)
|
635
636
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.12
|
data/bin/girb
CHANGED
data/bin/girb_runner.rb
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# Copyright (c) 2020-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
|
+
|
1
22
|
require 'puts_debuggerer'
|
2
23
|
require 'fileutils'
|
3
24
|
require 'etc'
|
Binary file
|
data/lib/glimmer/dsl/tk/dsl.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
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/expression'
|
23
|
+
require 'glimmer/data_binding/model_binding'
|
24
|
+
require 'glimmer/data_binding/tk/widget_binding'
|
25
|
+
require 'glimmer/data_binding/shine'
|
26
|
+
|
27
|
+
module Glimmer
|
28
|
+
module DSL
|
29
|
+
module Tk
|
30
|
+
class ShineDataBindingExpression < Expression
|
31
|
+
def can_interpret?(parent, keyword, *args, &block)
|
32
|
+
args.size == 0 and
|
33
|
+
block.nil? and
|
34
|
+
(parent.respond_to?(:has_attribute?) and parent.has_attribute?(keyword))
|
35
|
+
end
|
36
|
+
|
37
|
+
def interpret(parent, keyword, *args, &block)
|
38
|
+
Glimmer::DataBinding::Shine.new(parent, keyword)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -40,7 +40,7 @@ module Glimmer
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def content(&block)
|
43
|
-
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Tk::RootExpression.new, &block)
|
43
|
+
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Tk::RootExpression.new, keyword, *args, &block)
|
44
44
|
end
|
45
45
|
|
46
46
|
def set_attribute(attribute, *args)
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Copyright (c) 2020-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/tk/widget_proxy'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module Tk
|
26
|
+
# Custom treeview widget implementation
|
27
|
+
class TreeviewProxy < WidgetProxy
|
28
|
+
def has_attribute?(attribute, *args)
|
29
|
+
attribute == 'columns' || super
|
30
|
+
end
|
31
|
+
|
32
|
+
def set_attribute(attribute, *args)
|
33
|
+
if attribute == 'columns'
|
34
|
+
self[attribute] = args.first
|
35
|
+
else
|
36
|
+
super
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_attribute(attribute)
|
41
|
+
if attribute == 'columns'
|
42
|
+
self[attribute]
|
43
|
+
else
|
44
|
+
super
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -25,20 +25,6 @@ module Glimmer
|
|
25
25
|
#
|
26
26
|
# Follows the Proxy Design Pattern
|
27
27
|
class WidgetProxy
|
28
|
-
attr_reader :parent_proxy, :tk, :args
|
29
|
-
|
30
|
-
DEFAULT_INITIALIZERS = {
|
31
|
-
'combobox' => lambda do |tk|
|
32
|
-
tk.textvariable = ::TkVariable.new
|
33
|
-
end,
|
34
|
-
'label' => lambda do |tk|
|
35
|
-
tk.textvariable = ::TkVariable.new
|
36
|
-
end,
|
37
|
-
'entry' => lambda do |tk|
|
38
|
-
tk.textvariable = ::TkVariable.new
|
39
|
-
end,
|
40
|
-
}
|
41
|
-
|
42
28
|
class << self
|
43
29
|
def create(keyword, parent, args)
|
44
30
|
widget_proxy_class(keyword).new(keyword, parent, args)
|
@@ -75,12 +61,27 @@ module Glimmer
|
|
75
61
|
end
|
76
62
|
end
|
77
63
|
|
64
|
+
attr_reader :parent_proxy, :tk, :args, :keyword
|
65
|
+
|
66
|
+
DEFAULT_INITIALIZERS = {
|
67
|
+
'combobox' => lambda do |tk|
|
68
|
+
tk.textvariable = ::TkVariable.new
|
69
|
+
end,
|
70
|
+
'label' => lambda do |tk|
|
71
|
+
tk.textvariable = ::TkVariable.new
|
72
|
+
end,
|
73
|
+
'entry' => lambda do |tk|
|
74
|
+
tk.textvariable = ::TkVariable.new
|
75
|
+
end,
|
76
|
+
}
|
77
|
+
|
78
78
|
# Initializes a new Tk Widget
|
79
79
|
#
|
80
80
|
# Styles is a comma separate list of symbols representing Tk styles in lower case
|
81
81
|
def initialize(underscored_widget_name, parent_proxy, args)
|
82
82
|
@parent_proxy = parent_proxy
|
83
83
|
@args = args
|
84
|
+
@keyword = underscored_widget_name
|
84
85
|
tk_widget_class = self.class.tk_widget_class_for(underscored_widget_name)
|
85
86
|
@tk = tk_widget_class.new(@parent_proxy.tk, *args)
|
86
87
|
# a common widget initializer
|
@@ -133,7 +134,7 @@ module Glimmer
|
|
133
134
|
elsif tk_widget_has_attribute_setter?(attribute)
|
134
135
|
@tk.send(attribute_setter(attribute), *args) unless @tk.send(attribute) == args.first
|
135
136
|
elsif tk_widget_has_attribute_getter_setter?(attribute)
|
136
|
-
@tk.send(attribute, *args)
|
137
|
+
@tk.send(attribute, *args)
|
137
138
|
else
|
138
139
|
send(attribute_setter(attribute), args)
|
139
140
|
end
|
@@ -216,7 +217,7 @@ module Glimmer
|
|
216
217
|
end
|
217
218
|
|
218
219
|
def content(&block)
|
219
|
-
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Tk::WidgetExpression.new, &block)
|
220
|
+
Glimmer::DSL::Engine.add_content(self, Glimmer::DSL::Tk::WidgetExpression.new, keyword, *args, &block)
|
220
221
|
end
|
221
222
|
|
222
223
|
def method_missing(method, *args, &block)
|
@@ -48,7 +48,7 @@ class HelloComputed
|
|
48
48
|
entry {
|
49
49
|
grid column: 1, row: 0
|
50
50
|
width 15
|
51
|
-
text
|
51
|
+
text <=> [@contact, :first_name]
|
52
52
|
}
|
53
53
|
|
54
54
|
label {
|
@@ -58,7 +58,7 @@ class HelloComputed
|
|
58
58
|
entry {
|
59
59
|
grid column: 1, row: 1
|
60
60
|
width 15
|
61
|
-
text
|
61
|
+
text <=> [@contact, :last_name]
|
62
62
|
}
|
63
63
|
|
64
64
|
label {
|
@@ -68,7 +68,7 @@ class HelloComputed
|
|
68
68
|
entry {
|
69
69
|
grid column: 1, row: 2
|
70
70
|
width 15
|
71
|
-
text
|
71
|
+
text <=> [@contact, :year_of_birth]
|
72
72
|
}
|
73
73
|
|
74
74
|
label {
|
@@ -77,7 +77,7 @@ class HelloComputed
|
|
77
77
|
}
|
78
78
|
label {
|
79
79
|
grid column: 1, row: 3, sticky: 'w'
|
80
|
-
text
|
80
|
+
text <=> [@contact, :name, computed_by: [:first_name, :last_name]]
|
81
81
|
}
|
82
82
|
|
83
83
|
label {
|
@@ -86,7 +86,7 @@ class HelloComputed
|
|
86
86
|
}
|
87
87
|
label {
|
88
88
|
grid column: 1, row: 4, sticky: 'w'
|
89
|
-
text
|
89
|
+
text <=> [@contact, :age, on_write: :to_i, computed_by: :year_of_birth]
|
90
90
|
}
|
91
91
|
}
|
92
92
|
}.open
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-tk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09
|
11
|
+
date: 2021-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.1.
|
19
|
+
version: 2.1.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.1.
|
26
|
+
version: 2.1.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: puts_debuggerer
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.13.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.13.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: tk
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,20 +128,6 @@ dependencies:
|
|
114
128
|
- - ">="
|
115
129
|
- !ruby/object:Gem::Version
|
116
130
|
version: 0.2.1
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: puts_debuggerer
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: 0.13.1
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: 0.13.1
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: coveralls
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- VERSION
|
187
187
|
- bin/girb
|
188
188
|
- bin/girb_runner.rb
|
189
|
+
- glimmer-dsl-tk.gemspec
|
189
190
|
- icons/glimmer.png
|
190
191
|
- lib/glimmer-dsl-tk.rb
|
191
192
|
- lib/glimmer/data_binding/tk/list_selection_binding.rb
|
@@ -197,6 +198,7 @@ files:
|
|
197
198
|
- lib/glimmer/dsl/tk/dsl.rb
|
198
199
|
- lib/glimmer/dsl/tk/list_selection_data_binding_expression.rb
|
199
200
|
- lib/glimmer/dsl/tk/root_expression.rb
|
201
|
+
- lib/glimmer/dsl/tk/shine_data_binding_expression.rb
|
200
202
|
- lib/glimmer/dsl/tk/widget_expression.rb
|
201
203
|
- lib/glimmer/tk/button_proxy.rb
|
202
204
|
- lib/glimmer/tk/entry_proxy.rb
|
@@ -205,6 +207,7 @@ files:
|
|
205
207
|
- lib/glimmer/tk/list_proxy.rb
|
206
208
|
- lib/glimmer/tk/notebook_proxy.rb
|
207
209
|
- lib/glimmer/tk/root_proxy.rb
|
210
|
+
- lib/glimmer/tk/treeview_proxy.rb
|
208
211
|
- lib/glimmer/tk/widget_proxy.rb
|
209
212
|
- samples/hello/hello_combo.rb
|
210
213
|
- samples/hello/hello_computed.rb
|
@@ -233,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
236
|
- !ruby/object:Gem::Version
|
234
237
|
version: '0'
|
235
238
|
requirements: []
|
236
|
-
rubygems_version: 3.2.
|
239
|
+
rubygems_version: 3.2.28
|
237
240
|
signing_key:
|
238
241
|
specification_version: 4
|
239
242
|
summary: Glimmer DSL for Tk
|