glimmer-dsl-tk 0.0.61 → 0.0.62
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 +9 -9
- data/VERSION +1 -1
- data/glimmer-dsl-tk.gemspec +0 -0
- data/lib/glimmer/dsl/tk/built_in_dialog_expression.rb +1 -0
- data/lib/glimmer/tk/toplevel_proxy.rb +16 -3
- data/lib/glimmer/tk/widget_proxy.rb +4 -0
- data/samples/hello/hello_built_in_dialog.rb +1 -1
- data/samples/hello/hello_root.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6a4152765e0997cd3d29beec05f16be105a09ae868e49335fb09e81d552e576
|
4
|
+
data.tar.gz: 31c3f1d4ee33b5ab9dec7ccd76d11a6c50cde145cf3a5517401859b0ae16a45a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f4820bb0d35553b16fc9b37bfca7d2abdc463cbd2e958f462b5be5c53e79e7ae3abc918fa2bbc6775d642432b127fa3d26ff72d96195287fecd287e13a50a23
|
7
|
+
data.tar.gz: 6f5b093cd7f834e6d8126142d5f63e66dde7c164b463eee577cd8b177d27784335d3f2df88555ce103c68a29eaed72ab1ec1e608018e8b76655c9704e77c0826
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.0.62
|
4
|
+
|
5
|
+
- `icon_photo` as alias for `iconphoto` attribute on `root` and `toplevel`
|
6
|
+
- `initial_color` as alias for `initialcolor` attribute on `choose_color` built-in dialog
|
7
|
+
|
3
8
|
## 0.0.61
|
4
9
|
|
5
10
|
- Fix issue with Hello, Entry! breaking after the latest release due to mistakenly converting color `'red'` to `'#red'` by thinking it is hex
|
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.62
|
2
2
|
## Ruby Tk 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)
|
@@ -195,7 +195,7 @@ gem install glimmer-dsl-tk
|
|
195
195
|
|
196
196
|
Add the following to `Gemfile`:
|
197
197
|
```
|
198
|
-
gem 'glimmer-dsl-tk', '0.0.
|
198
|
+
gem 'glimmer-dsl-tk', '0.0.62'
|
199
199
|
```
|
200
200
|
|
201
201
|
And, then run:
|
@@ -309,7 +309,7 @@ keyword(args) | attributes | event bindings & callbacks
|
|
309
309
|
------------- | ---------- | ---------
|
310
310
|
`button` | `text`, `image` (optional keyword args: `subsample`, `zoom`, `from`, `to`, `shrink`, `compositingrule`), `compound` (`'center', 'top', 'bottom', 'left', 'right'`), `default` (`'active', 'normal'`) | `command {}`
|
311
311
|
`checkbutton` | `text`, `variable` (Boolean), `image` (optional keyword args: `subsample`, `zoom`, `from`, `to`, `shrink`, `compositingrule`), `compound` (`'center', 'top', 'bottom', 'left', 'right'`), `onvalue` (default: `1`), `offvalue` (default: `0`) | `command {}`
|
312
|
-
`choose_color(parent: nil,
|
312
|
+
`choose_color(parent: nil, initial_color: 'white', title: 'Colors')` | None | None
|
313
313
|
`choose_directory(parent: nil)` | None | None
|
314
314
|
`choose_font(family: nil, size: nil, weight: nil) {|font| ... }` | None | None
|
315
315
|
`combobox` | `state`, `text` | `'ComboboxSelected'`
|
@@ -328,11 +328,11 @@ keyword(args) | attributes | event bindings & callbacks
|
|
328
328
|
`menu_item(style = :command, label: , underline: )` (style also can be `:radiobutton`, `:checkbutton`, `:separator`, `:about`, `:preferences`, `:quit`, `:help`) | `state`, `accelerator`, `selection` & `variable` (if `:radiobutton` or `:checkbutton`), `image`, `compound` | `command`
|
329
329
|
`notebook` | None | None
|
330
330
|
`radiobutton` | `text`, `variable` (Boolean), `image` (optional keyword args: `subsample`, `zoom`, `from`, `to`, `shrink`, `compositingrule`), `compound` (`'center', 'top', 'bottom', 'left', 'right'`), `value` (default: `text`) | `command {}`
|
331
|
-
`root` | `title`, `
|
331
|
+
`root` | `title`, `icon_photo`, `background`, `alpha`, `escapable`, `fullscreen?`, `topmost?`, `transparent?`, `stackorder`, `winfo_screendepth`, `winfo_screenvisual`, `winfo_screenwidth`, `winfo_screenheight`, `winfo_pixels('li')`, `winfo_screen`, `wm_maxsize`, `state` (`'normal', 'iconic', 'withdrawn', 'icon', 'zoomed'`) | `'DELETE_WINDOW'`, `'OPEN_WINDOW'`
|
332
332
|
`scrollbar` | `orient` | `command`
|
333
333
|
`scrollbar_frame` | `xscrollbar` (Boolean or scrollbar widget proxy), `yscrollbar` (Boolean or scrollbar widget proxy) | None
|
334
334
|
`separator` | `orient` (`'horizontal' (default) or 'vertical'`) | None
|
335
|
-
`toplevel` | `title`, `
|
335
|
+
`toplevel` | `title`, `icon_photo`, `background`, `alpha`, `escapable`, `fullscreen?`, `topmost?`, `transparent?`, `stackorder`, `winfo_screendepth`, `winfo_screenvisual`, `winfo_screenwidth`, `winfo_screenheight`, `winfo_pixels('li')`, `winfo_screen`, `wm_maxsize`, `state` (`'normal', 'iconic', 'withdrawn', 'icon', 'zoomed'`) | `'DELETE_WINDOW'`
|
336
336
|
`text` | `value`, [many more attributes](https://tcl.tk/man/tcl8.6/TkCmd/text.htm#M116) | `'modified'`, `'selection'`, `'insert_mark_moved'` (alias: `'insert_mark_move', 'InsertMarkMove', 'InsertMarkMoved'`)
|
337
337
|
`x_scrollbar` | `orient` (`'horizontal'`) | `command`
|
338
338
|
`y_scrollbar` | `orient` (`'vertical'`) | `command`
|
@@ -555,7 +555,7 @@ When nesting `frame` under `notebook`, you can pass a `:text` keyword argument t
|
|
555
555
|
|
556
556
|
#### Icon Photo
|
557
557
|
|
558
|
-
The `
|
558
|
+
The `icon_photo` attribute (alias for `iconphoto`) on `root` is set to the Glimmer icon by default if no icon photo is supplied.
|
559
559
|
|
560
560
|
Otherwise, [Glimmer DSL for Tk](https://rubygems.org/gems/glimmer-dsl-tk) is smart enough to accept an image path directly (no need to wrap with `TkPhotoImage`)
|
561
561
|
|
@@ -564,7 +564,7 @@ Example with direct image path (you may copy/paste in [`girb`](#girb-glimmer-irb
|
|
564
564
|
```ruby
|
565
565
|
root {
|
566
566
|
title 'Title'
|
567
|
-
|
567
|
+
icon_photo 'icons/glimmer.png'
|
568
568
|
}.open
|
569
569
|
```
|
570
570
|
|
@@ -573,7 +573,7 @@ Example with `TkPhotoImage` object (you may copy/paste in [`girb`](#girb-glimmer
|
|
573
573
|
```ruby
|
574
574
|
root {
|
575
575
|
title 'Title'
|
576
|
-
|
576
|
+
icon_photo TkPhotoImage.new(file: 'icons/glimmer.png')
|
577
577
|
}.open
|
578
578
|
```
|
579
579
|
|
@@ -1535,7 +1535,7 @@ include Glimmer
|
|
1535
1535
|
|
1536
1536
|
root { |r|
|
1537
1537
|
title 'Hello, Root!'
|
1538
|
-
|
1538
|
+
icon_photo File.expand_path('../../icons/glimmer.png', __dir__)
|
1539
1539
|
width 400
|
1540
1540
|
height 200
|
1541
1541
|
x -150
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.62
|
data/glimmer-dsl-tk.gemspec
CHANGED
Binary file
|
@@ -38,6 +38,7 @@ module Glimmer
|
|
38
38
|
def interpret(parent, keyword, *args, &block)
|
39
39
|
if args.first.is_a?(Hash)
|
40
40
|
options = args.first.symbolize_keys
|
41
|
+
options[:initialcolor] = options.delete(:initial_color) if options.keys.include?(:initial_color)
|
41
42
|
options[:filetypes] = options.delete(:file_types) if options.keys.include?(:file_types)
|
42
43
|
options[:filetypes] = options[:filetypes].map { |key, value| "{#{key}} {#{value}}" } if options[:filetypes].is_a?(Hash)
|
43
44
|
options[:parent] = options[:parent].tk if options[:parent].is_a?(Glimmer::Tk::RootProxy)
|
@@ -48,14 +48,14 @@ module Glimmer
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def has_attribute?(attribute, *args)
|
51
|
-
%w[width height x y].include?(attribute.to_s) || super
|
51
|
+
%w[width height x y icon_photo].include?(attribute.to_s) || super
|
52
52
|
end
|
53
53
|
|
54
54
|
def set_attribute(attribute, *args)
|
55
55
|
case attribute.to_s
|
56
|
-
when 'iconphoto'
|
56
|
+
when 'iconphoto', 'icon_photo'
|
57
57
|
args[0..-1] = [image_argument(args)]
|
58
|
-
super
|
58
|
+
super('iconphoto', *args)
|
59
59
|
when 'resizable'
|
60
60
|
if args.size == 1 && !args.first.is_a?(Array)
|
61
61
|
self.resizable = [args.first]*2
|
@@ -67,6 +67,19 @@ module Glimmer
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
def get_attribute(attribute)
|
71
|
+
case attribute.to_s
|
72
|
+
when 'icon_photo'
|
73
|
+
super('iconphoto')
|
74
|
+
else
|
75
|
+
super
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def icon_photo
|
80
|
+
iconphoto
|
81
|
+
end
|
82
|
+
|
70
83
|
def width
|
71
84
|
geometry.split(REGEX_GEOMETRY)[0].to_i
|
72
85
|
end
|
@@ -410,6 +410,10 @@ module Glimmer
|
|
410
410
|
getter: {name: 'text', invoker: lambda { |widget, args| @tk.title }},
|
411
411
|
setter: {name: 'text=', invoker: lambda { |widget, args| @tk.title = args.first }},
|
412
412
|
},
|
413
|
+
'icon_photo' => {
|
414
|
+
getter: {name: 'icon_photo', invoker: lambda { |widget, args| @tk.iconphoto }},
|
415
|
+
setter: {name: 'icon_photo=', invoker: lambda { |widget, args| @tk.iconphoto = image_argument(args) }},
|
416
|
+
},
|
413
417
|
},
|
414
418
|
}
|
415
419
|
end
|
@@ -62,7 +62,7 @@ root { |w|
|
|
62
62
|
# initialcolor is optional (defaults to 'white').
|
63
63
|
# It can be a built-in color (e.g. 'AliceBlue') or hex (e.g. '#FFFF00')
|
64
64
|
# Full list of built-in colors is at: https://tcl.tk/man/tcl8.6/TkCmd/colors.htm
|
65
|
-
chosen_color = choose_color(parent: w, title: 'Choose Color',
|
65
|
+
chosen_color = choose_color(parent: w, title: 'Choose Color', initial_color: '#FFFF00')
|
66
66
|
@result_label.text = chosen_color
|
67
67
|
end
|
68
68
|
}
|
data/samples/hello/hello_root.rb
CHANGED
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.62
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|