glimmer-dsl-tk 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +4 -4
- data/VERSION +1 -1
- data/bin/girb_runner.rb +1 -1
- data/glimmer-dsl-tk.gemspec +0 -0
- data/lib/glimmer/tk/text_proxy.rb +11 -23
- data/samples/elaborate/meta_sample.rb +1 -1
- data/samples/hello/hello_text.rb +4 -4
- 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: daadce6a22be7ae817b7e0a3f5679a8c3d04d7ed6a0205fa30b03da206dc156a
|
4
|
+
data.tar.gz: f0324e91b54ac7e3179ffe122de59f714731d336d982937a92e76c6d0fd95079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 461c26dee79b7a387eddc3107f342dffe14b39d49f307ab469a49afda8112af2ad75a350f88ab64fad616e458a217570c0f3414570c195aeef884c170bff9656
|
7
|
+
data.tar.gz: b7b2cd0c333de05d2c923ed461147fd245d58f55a622e57f7631c049b32344b7730801e3c49e271e5a0d7e884dcb1f64981f0feb5a57300952e05f191b1537eb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.0.35
|
4
|
+
|
5
|
+
- Improved Meta-Sample by utilizing Ruby from `RbConfig.ruby`
|
6
|
+
- Improved girb_runner.rb to be more platform independent
|
7
|
+
- Fixed `text` widget binding of standard bind events (e.g. `'KeyPress'` or `'ButtonPress'`)
|
8
|
+
- Fixed Hello, Text! issue with not being able to bring up Find Dialog once all text is deleted and new text is entered
|
9
|
+
- Fixed undo/redo issue
|
10
|
+
|
3
11
|
## 0.0.34
|
4
12
|
|
5
13
|
- When applying a `text` selection format without having a selection, have it apply to current insert mark word
|
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.35
|
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)
|
@@ -55,8 +55,9 @@ NOTE: Glimmer DSL for Tk is currently in early alpha mode (incomplete). Please h
|
|
55
55
|
|
56
56
|
Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
57
57
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
58
|
-
- [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
|
59
58
|
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
59
|
+
- [glimmer-dsl-libui](https://github.com/AndyObtiva/glimmer-dsl-libui): Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)
|
60
|
+
- [glimmer-dsl-gtk](https://github.com/AndyObtiva/glimmer-dsl-gtk): Ruby-GNOME Desktop Development GUI Library
|
60
61
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
61
62
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS (Cascading Style Sheets)
|
62
63
|
|
@@ -158,7 +159,7 @@ gem install glimmer-dsl-tk
|
|
158
159
|
|
159
160
|
Add the following to `Gemfile`:
|
160
161
|
```
|
161
|
-
gem 'glimmer-dsl-tk', '~> 0.0.
|
162
|
+
gem 'glimmer-dsl-tk', '~> 0.0.35'
|
162
163
|
```
|
163
164
|
|
164
165
|
And, then run:
|
@@ -736,7 +737,6 @@ More details can be found in the [Hello, Button!](#hello-button) sample below.
|
|
736
737
|
## Gotchas
|
737
738
|
|
738
739
|
- Setting `background` attribute on `frame` or `label` does not work in `'aqua'` theme on the Mac (only in `'classic'` theme)
|
739
|
-
- `text` widget does not track `KeyPress`/`KeyRelease` events perfectly (installed via `on()` listener keyword). It seems that when all text is deleted, it stops tracking key presses/releases until a number of new lines have been added to `text` `value` attribute
|
740
740
|
|
741
741
|
## Samples
|
742
742
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.35
|
data/bin/girb_runner.rb
CHANGED
@@ -27,7 +27,7 @@ require_relative '../lib/glimmer-dsl-tk'
|
|
27
27
|
|
28
28
|
include Glimmer
|
29
29
|
|
30
|
-
GIRB_RUNNER_EXIT_FILE = "#{
|
30
|
+
GIRB_RUNNER_EXIT_FILE = "#{Dir.home}/.girb_runner_exit"
|
31
31
|
FileUtils.rm_rf GIRB_RUNNER_EXIT_FILE
|
32
32
|
|
33
33
|
@exit_method = method(:exit)
|
data/glimmer-dsl-tk.gemspec
CHANGED
Binary file
|
@@ -39,7 +39,6 @@ module Glimmer
|
|
39
39
|
@modified_count ||= 0
|
40
40
|
@modified_count += 1
|
41
41
|
listener.call(*args)
|
42
|
-
apply_all_tag
|
43
42
|
@insert_mark_moved_proc&.call
|
44
43
|
@tk.modified = false
|
45
44
|
end
|
@@ -72,28 +71,17 @@ module Glimmer
|
|
72
71
|
end
|
73
72
|
end
|
74
73
|
else
|
75
|
-
|
76
|
-
# TODO make listener pass an event that has a modifiers attribute for easy representation of :shift, :meta, :control, etc... while a letter button is pressed
|
77
|
-
@listeners ||= {}
|
78
|
-
begin
|
79
|
-
@listeners[listener_name] ||= []
|
80
|
-
@tk.tag_bind(ALL_TAG, listener_name) { |event| @listeners[listener_name].each {|l| l.call(event)} } if @listeners[listener_name].empty?
|
81
|
-
@listeners[listener_name] << listener
|
82
|
-
rescue => e
|
83
|
-
@listeners.delete(listener_name)
|
84
|
-
Glimmer::Config.logger.debug {"Unable to bind to #{listener_name} .. attempting to surround with <>"}
|
85
|
-
Glimmer::Config.logger.debug {e.full_message}
|
86
|
-
listener_name = "<#{listener_name}" if !listener_name.start_with?('<')
|
87
|
-
listener_name = "#{listener_name}>" if !listener_name.end_with?('>')
|
88
|
-
@listeners[listener_name] ||= []
|
89
|
-
@tk.tag_bind(ALL_TAG, listener_name) { |event| @listeners[listener_name].each {|l| l.call(event)} } if @listeners[listener_name].empty?
|
90
|
-
@listeners[listener_name] << listener
|
91
|
-
end
|
74
|
+
super
|
92
75
|
end
|
93
76
|
end
|
94
77
|
|
95
78
|
def edit_undo
|
96
|
-
|
79
|
+
# <Modified> fires twice the first time, which is equivalent to one change.
|
80
|
+
if @modified_count.to_i > 2
|
81
|
+
# must count the extra 2 modified count that will occur upon undo too
|
82
|
+
@modified_count -= 4
|
83
|
+
@tk.edit_undo
|
84
|
+
end
|
97
85
|
end
|
98
86
|
|
99
87
|
def edit_redo
|
@@ -444,16 +432,16 @@ module Glimmer
|
|
444
432
|
self.wrap = 'none'
|
445
433
|
self.padx = 5
|
446
434
|
self.pady = 5
|
447
|
-
|
435
|
+
# on('Modified') { apply_all_tag }
|
448
436
|
end
|
449
437
|
|
450
438
|
def clone_font(font)
|
451
439
|
::TkFont.new(Hash[font.actual])
|
452
440
|
end
|
453
441
|
|
454
|
-
|
455
|
-
|
456
|
-
|
442
|
+
# def apply_all_tag
|
443
|
+
# @tk.tag_add(ALL_TAG, '1.0', 'end')
|
444
|
+
# end
|
457
445
|
end
|
458
446
|
end
|
459
447
|
end
|
@@ -56,7 +56,7 @@ class MetaSample
|
|
56
56
|
|
57
57
|
def run_sample(sample)
|
58
58
|
Thread.new do
|
59
|
-
command = "ruby -r #{glimmer_dsl_tk_file} #{sample} 2>&1"
|
59
|
+
command = "#{RbConfig.ruby} -r #{glimmer_dsl_tk_file} #{sample} 2>&1"
|
60
60
|
result = ''
|
61
61
|
IO.popen(command) do |f|
|
62
62
|
f.each_line do |line|
|
data/samples/hello/hello_text.rb
CHANGED
@@ -286,10 +286,6 @@ class HelloText
|
|
286
286
|
undo true
|
287
287
|
value <=> [self, :document]
|
288
288
|
|
289
|
-
on('KeyPress') do |event|
|
290
|
-
show_find_dialog if (event.keysym == 'f') && ((OS.mac? && event.state == 8) || (!OS.mac? && event.state == 4))
|
291
|
-
end
|
292
|
-
|
293
289
|
on('InsertMarkMoved') do
|
294
290
|
self.font_family = @text.applied_font_format_value('family')
|
295
291
|
self.font_size = @text.applied_font_format_value('size')
|
@@ -302,6 +298,10 @@ class HelloText
|
|
302
298
|
@justify_center_button.default = @text.applied_format_value('justify') == 'center' ? 'active' : 'normal'
|
303
299
|
@justify_right_button.default = @text.applied_format_value('justify') == 'right' ? 'active' : 'normal'
|
304
300
|
end
|
301
|
+
|
302
|
+
on('KeyPress') do |event|
|
303
|
+
show_find_dialog if (event.keysym == 'f') && ((OS.mac? && event.state == 8) || (!OS.mac? && event.state == 4))
|
304
|
+
end
|
305
305
|
}
|
306
306
|
}
|
307
307
|
@root.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.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|