glimmer-dsl-tk 0.0.52 → 0.0.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +3 -2
- data/VERSION +1 -1
- data/glimmer-dsl-tk.gemspec +0 -0
- data/lib/glimmer/tk/menu_item_proxy.rb +9 -1
- data/samples/hello/hello_menu_bar.rb +4 -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: 4bc998830956c028c331da19e9238e69fe15198a0c2741af217cd15cae8fceb8
|
4
|
+
data.tar.gz: '040971d080dae49ebcb201631802566bcb415ddcd72ca623d6cca350c4587058'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a573287857c8f89fb58226dc6c8f1c1629f5a7f7c2dac59952e3459738ba582b89539cc1365a8ebe0134d0c132e62757677fb438480a20b93f25c346846b20f8
|
7
|
+
data.tar.gz: 404e13705e7354d5e0bb2ae15993c7b17d09e77cb7161e111ab5dc908bbe18523501dffc041ff7ce69a71fb70db8d1cca8ef306fbab26f9d07faa2e5933eca53
|
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 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.53
|
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
|
[![Ruby](https://github.com/AndyObtiva/glimmer-dsl-tk/actions/workflows/ruby.yml/badge.svg)](https://github.com/AndyObtiva/glimmer-dsl-tk/actions/workflows/ruby.yml)
|
@@ -186,7 +186,7 @@ gem install glimmer-dsl-tk
|
|
186
186
|
|
187
187
|
Add the following to `Gemfile`:
|
188
188
|
```
|
189
|
-
gem 'glimmer-dsl-tk', '0.0.
|
189
|
+
gem 'glimmer-dsl-tk', '0.0.53'
|
190
190
|
```
|
191
191
|
|
192
192
|
And, then run:
|
@@ -3763,6 +3763,7 @@ https://gitlab.com/fjc/circule
|
|
3763
3763
|
## Resources
|
3764
3764
|
|
3765
3765
|
- [Tk Tutorial](https://tkdocs.com/tutorial/index.html)
|
3766
|
+
- [Official Tk Command Reference](https://tcl.tk/man/tcl8.6/TkCmd/contents.htm)
|
3766
3767
|
- [Code Master Blog](https://andymaleh.blogspot.com/search/label/Tk)
|
3767
3768
|
|
3768
3769
|
## Help
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.53
|
data/glimmer-dsl-tk.gemspec
CHANGED
Binary file
|
@@ -43,6 +43,7 @@ module Glimmer
|
|
43
43
|
def initialize(underscored_widget_name, parent_proxy, args, &block)
|
44
44
|
@options = args.last.is_a?(Hash) ? args.last : {}
|
45
45
|
@label = @options[:label]
|
46
|
+
@label ||= 'About' if args.first == :about
|
46
47
|
super
|
47
48
|
end
|
48
49
|
|
@@ -61,10 +62,17 @@ module Glimmer
|
|
61
62
|
def accelerator_event
|
62
63
|
accelerator_parts = @accelerator.split('+')
|
63
64
|
accelerator_parts.map do |accelerator_part|
|
64
|
-
ACCELERATOR_MODIFIER_EVENT_MAP[accelerator_part.capitalize] ||
|
65
|
+
ACCELERATOR_MODIFIER_EVENT_MAP[accelerator_part.capitalize] ||
|
66
|
+
(accelerator_part.size == 1 && accelerator_part.downcase) ||
|
67
|
+
(function_key?(accelerator_part) && accelerator_part.upcase) ||
|
68
|
+
accelerator_part
|
65
69
|
end.join('-')
|
66
70
|
end
|
67
71
|
|
72
|
+
def function_key?(string)
|
73
|
+
string.downcase.match(/^f\d+$/)
|
74
|
+
end
|
75
|
+
|
68
76
|
def label=(value)
|
69
77
|
@last_label = @label
|
70
78
|
@label = value
|
@@ -41,7 +41,8 @@ root { |r|
|
|
41
41
|
# Mac-specific application menu (right next to the Apple menu)
|
42
42
|
if OS.mac?
|
43
43
|
menu(:application) {
|
44
|
-
|
44
|
+
# menu_item(:about, label: 'About My Application') {
|
45
|
+
menu_item(:about) {
|
45
46
|
accelerator 'Command+A'
|
46
47
|
|
47
48
|
on('command') do
|
@@ -99,6 +100,8 @@ root { |r|
|
|
99
100
|
menu_item(:separator)
|
100
101
|
|
101
102
|
menu_item(label: 'Exit', underline: 1) {
|
103
|
+
accelerator 'Alt+F4'
|
104
|
+
|
102
105
|
on('command') do
|
103
106
|
exit(0)
|
104
107
|
end
|