glimmer-dsl-tk 0.0.41 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ce065d32aa469d1e55999bdcd730d0837110d6fb7cda8fd8992e297c9ed600
4
- data.tar.gz: 48c7e0517d0135656c36698cee1d2ccf65c342aed1793c135766e860572dec6a
3
+ metadata.gz: fbb49ce9e435d0313cdec33a81afec3ad4d7716ee6e8363004651417d3535704
4
+ data.tar.gz: 9ad46f88ace884c5d670d2449728369af8510b95e24c291a3bda7580cef65820
5
5
  SHA512:
6
- metadata.gz: 4f06cb1144383c64b489f58016c880c4fb82d506ce63f8dd1953448748017b9f3910c0d7792d926d5479bc89564a503639b406e3d62728a690e11ef8e81e3126
7
- data.tar.gz: 2d6fa5b4cede272fd2aeec4a83a58cfd2dc8d59157692052b179d4ec91a1a7925061f20bf0dcc06160fb9d375ac493c5f75169106ea61878a011a8c5fec022f9
6
+ metadata.gz: d58a0179466efe9991f53eefb23c6dd3749c386230d70722e0a6c3f24c85f2affc361e18c21d65b34b2cb37269dfb8c7ceff9953a1bc5059f1db971051b0c4c8
7
+ data.tar.gz: bad07c9519d483534306b04be7e4d110fe302c6dc3f03028d85aa5c85fcfe01437c0471d58b49e3db013abc99d6f55535d5aefacc4bdc651df50b30ecda467e0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.42
4
+
5
+ - Add vertical/horizontal scrollbars to Meta-Sample
6
+ - Keep only vertical scrollbar in Hello, Text!
7
+ - Fix issue with including bwidgets and iwidgets in Windows
8
+ - Fix Hello, Menu Bar! sample in Windows (by disabling Windows-special System menu, which does not seem to be working in Tk)
9
+
3
10
  ## 0.0.41
4
11
 
5
12
  - Support `scrollbar_frame` Glimmer custom widget as a frame that automatically provides scrollbars when its content's size exceeds its size
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.41
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.42
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)
@@ -181,7 +181,7 @@ gem install glimmer-dsl-tk
181
181
 
182
182
  Add the following to `Gemfile`:
183
183
  ```
184
- gem 'glimmer-dsl-tk', '~> 0.0.41'
184
+ gem 'glimmer-dsl-tk', '0.0.42'
185
185
  ```
186
186
 
187
187
  And, then run:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.41
1
+ 0.0.42
Binary file
@@ -71,8 +71,9 @@ module Glimmer
71
71
  @tk = ::TkSysMenu_Help.new(@parent_proxy.tk)
72
72
  elsif @parent_proxy.parent_proxy.is_a?(ToplevelProxy) && OS.mac? && window?
73
73
  @tk = ::Tk::TkSysMenu_Window.new(@parent_proxy.tk)
74
- elsif @parent_proxy.parent_proxy.is_a?(ToplevelProxy) && OS.windows? && system?
75
- @tk = ::TkSysMenu_System.new(@parent_proxy.tk)
74
+ # Windows system menu does not seem to work
75
+ # elsif @parent_proxy.parent_proxy.is_a?(ToplevelProxy) && OS.windows? && system?
76
+ # @tk = ::TkSysMenu_System.new(@parent_proxy.tk)
76
77
  else
77
78
  tk_widget_class = self.class.tk_widget_class_for(@keyword)
78
79
  @tk = tk_widget_class.new(@parent_proxy.tk)
@@ -127,7 +127,7 @@ module Glimmer
127
127
  end
128
128
 
129
129
  def tk_widget_has_attribute_setter?(attribute)
130
- return true if @tk.respond_to?(attribute)
130
+ return true if @tk.respond_to?(attribute) && attribute != 'focus' # TODO configure exceptions via constant if needed
131
131
  result = nil
132
132
  begin
133
133
  # TK Widget currently doesn't support respond_to? properly, so I have to resort to this trick for now
@@ -384,6 +384,7 @@ module Glimmer
384
384
  if observer.is_a?(Glimmer::DataBinding::ModelBinding)
385
385
  model = observer.model
386
386
  options_model_property = observer.property_name + '_options'
387
+ # TODO perform data-binding to values too
387
388
  @tk.values = model.send(options_model_property) if model.respond_to?(options_model_property)
388
389
  end
389
390
  @tk.bind('<ComboboxSelected>') {
@@ -27,8 +27,8 @@ require 'glimmer'
27
27
  require 'puts_debuggerer' if ENV['pd'].to_s.downcase == 'true'
28
28
  # require 'super_module'
29
29
  require 'tk'
30
- require 'tkextlib/bwidget'
31
- require 'tkextlib/iwidgets'
30
+ #require 'tkextlib/bwidget' # does not work on Windows
31
+ #require 'tkextlib/iwidgets' # does not work on Windows
32
32
  require 'os'
33
33
  require 'facets/hash/symbolize_keys'
34
34
  require 'facets/string/underscore'
@@ -130,6 +130,16 @@ class MetaSample
130
130
  grid row: 0, column: 1, column_weight: 1
131
131
  value File.read(file_path_for(selected_sample))
132
132
  }
133
+
134
+ @yscrollbar = scrollbar {
135
+ grid row: 0, column: 2
136
+ }
137
+ @code_text.yscrollbar @yscrollbar
138
+
139
+ @xscrollbar = scrollbar {
140
+ grid row: 1, column: 1, column_span: 2
141
+ }
142
+ @code_text.xscrollbar @xscrollbar
133
143
  }
134
144
  @root.open
135
145
  end
@@ -25,7 +25,7 @@ include Glimmer
25
25
 
26
26
  COLORS = [:white, :red, :yellow, :green, :blue, :magenta, :gray, :black]
27
27
 
28
- Tk::Tile::Style.theme_use "classic" # this enables setting background on label just for demo purposes
28
+ Tk::Tile::Style.theme_use 'classic' if OS.mac? # this enables setting background on label just for demo purposes
29
29
 
30
30
  root { |r|
31
31
  title 'Hello, Menu Bar!'
@@ -65,11 +65,6 @@ root { |r|
65
65
  }
66
66
  end
67
67
 
68
- # Windows-specific system menu (to the top-left of the window frame)
69
- if OS.windows?
70
- menu(label: 'System')
71
- end
72
-
73
68
  menu(label: 'File', underline: 0) {
74
69
  menu_item(label: 'New', underline: 0) {
75
70
  accelerator OS.mac? ? 'Command+N' : 'Control+N'
@@ -166,7 +161,7 @@ root { |r|
166
161
  end
167
162
  }
168
163
 
169
- menu(label: 'Country', underline: 3) {
164
+ menu(label: 'Country', underline: 0) {
170
165
  ['denmark', 'finland', 'france', 'germany', 'italy', 'mexico', 'netherlands', 'norway', 'usa'].each do |image_name|
171
166
  menu_item(:radiobutton, label: image_name.capitalize) {
172
167
  selection image_name == 'usa'
@@ -176,7 +171,7 @@ root { |r|
176
171
  end
177
172
  }
178
173
 
179
- menu(label: 'Format', underline: 0) {
174
+ menu(label: 'Format', underline: 3) {
180
175
  menu(label: 'Background Color', underline: 0) {
181
176
  COLORS.each { |color_style|
182
177
  menu_item(:radiobutton, label: color_style.to_s.split('_').map(&:capitalize).join(' ')) {
@@ -282,7 +282,7 @@ class HelloText
282
282
 
283
283
  @text = text {
284
284
  grid row: 1, column: 0, row_weight: 1
285
- # wrap 'word'
285
+ wrap 'word'
286
286
  undo true
287
287
  value <=> [self, :document]
288
288
 
@@ -304,15 +304,10 @@ class HelloText
304
304
  end
305
305
  }
306
306
 
307
- @yscrollbar = y_scrollbar {
307
+ @yscrollbar = scrollbar {
308
308
  grid row: 1, column: 1
309
309
  }
310
310
  @text.yscrollbar @yscrollbar
311
-
312
- @xscrollbar = x_scrollbar {
313
- grid row: 2, column: 0, column_span: 2, row_weight: 0
314
- }
315
- @text.xscrollbar @xscrollbar
316
311
  }
317
312
  @root.open
318
313
  end
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.41
4
+ version: 0.0.42
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-13 00:00:00.000000000 Z
11
+ date: 2021-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -310,7 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
310
  - !ruby/object:Gem::Version
311
311
  version: '0'
312
312
  requirements: []
313
- rubygems_version: 3.2.22
313
+ rubygems_version: 3.2.31
314
314
  signing_key:
315
315
  specification_version: 4
316
316
  summary: Glimmer DSL for Tk