glimmer-dsl-libui 0.12.8 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f05c17af8a9c7188911ef270e4f2ea7880b2f8db99f7f6eb95a566cc640a9cbd
4
- data.tar.gz: e33c187107d619b3a59f3009dbe232ea79cb3da8ddf4ce59f480abebd25727cc
3
+ metadata.gz: 43ae658184be717b4516022b2233f3ecba9dca4f258b307bc81b9488b8387f70
4
+ data.tar.gz: e09b32411f1301deba1312b78f86288708dc56964e08a97165b1d55e156dfc80
5
5
  SHA512:
6
- metadata.gz: 67f64ec9bd98928547a399bc3e2d29a338c9b6fa648b58985ddb1249ad01f3a0540194310541b3eba571caa43ca9e795897886c437cf214264d33f06e7d2b094
7
- data.tar.gz: 00e2ca7c876929dde0b653f27be812d8e4426e2b2ce560141883758ca324559cab32e6b47c464fad6b8eb5e31f73a3206d85cf436a4c61ad0e5f976e86adafc7
6
+ metadata.gz: 899b60f962b0df986a447353e2cd80578a1306fadee0edfefea1bf9089c8856576189dfca33a3bb2ebb8239394f9d719195cef03bbc9e31eb714ef44058b3186
7
+ data.tar.gz: bb6ec4a596ce49130190fa3870ca472965d5b958ec05c1e0d7ecdf2a3c0593ab290079d4dc60823c098f610f8bb85c8270330c5ecd3e634c0f5ecfbe11becf21
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.13.0
4
+
5
+ - Support `combobox` `items` unidirectional data-binding
6
+ - Update color gem to version 2
7
+ - Refactor/simplify examples/button_counter.rb by removing unnecessary `vertical_box` (Glimmer DSL for LibUI implicitly adds it automatically when needed)
8
+ - Fix issue of `combobox` `selected_item` bidirectional data-binding not working correctly like `selected` data-binding does
9
+
3
10
  ## 0.12.8
4
11
 
5
12
  - Fix issue with refined_table crashing when filtering by a specific column (e.g. name:john) and column is not found
data/README.md CHANGED
@@ -1,12 +1,12 @@
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 LibUI 0.12.8
2
- ## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja))
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 LibUI 0.13.0
2
+ ## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html))
3
3
  ### The Quickest Way From Zero To GUI
4
4
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
5
5
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
6
 
7
7
  **[If You Liked Shoes, You'll Love Glimmer!](https://github.com/AndyObtiva/glimmer#faq)**
8
8
 
9
- (**[Fukuoka Ruby Award Competition 2022 Special Award Winner](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html)** [[Award Announcement]](http://www.digitalfukuoka.jp/topics/187?locale=ja))
9
+ (**[Fukuoka Ruby Award Competition 2022 Special Award Winner](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html)**)
10
10
 
11
11
  (**[***RubyConf 2024 Workshop - How To Build Basic Desktop Applications in Ruby***](https://www.youtube.com/watch?v=TTSqRdTVtDY)**)
12
12
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  [**(Ruby Rogues Podcast Interview - Desktop Apps in Ruby ft. Andy)**](https://andymaleh.blogspot.com/2022/05/ruby-rogues-podcast-interview-desktop.html)
18
18
 
19
- [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [LibUI](https://github.com/libui-ng/libui-ng) is a [Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja) prerequisite-free [MRI Ruby](https://www.ruby-lang.org) desktop development cross-platform native GUI (Graphical User Interface) library. No need to pre-install any prerequisites. Just install the [gem](https://rubygems.org/gems/glimmer-dsl-libui) and have cross-platform native GUI that just works on Mac, Windows, and Linux!
19
+ [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [LibUI](https://github.com/libui-ng/libui-ng) is a [Fukuoka Award Winning](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html) prerequisite-free [MRI Ruby](https://www.ruby-lang.org) desktop development cross-platform native GUI (Graphical User Interface) library. No need to pre-install any prerequisites. Just install the [gem](https://rubygems.org/gems/glimmer-dsl-libui) and have cross-platform native GUI that just works on Mac, Windows, and Linux!
20
20
 
21
21
  Mac | Windows | Linux
22
22
  ----|---------|------
@@ -26,6 +26,8 @@ Mac | Windows | Linux
26
26
 
27
27
  The main trade-off in using [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) as opposed to [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) or [Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk) is the fact that [SWT](https://www.eclipse.org/swt/) and [Tk](https://www.tcl.tk/) are more mature than mid-alpha [libui](https://github.com/libui-ng/libui-ng) as GUI toolkits. Still, if there is only a need to build a small simple application, [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) could be a good convenient choice due to having zero prerequisites (beyond Ruby and the dependencies included in the [Ruby gem](https://rubygems.org/gems/glimmer-dsl-libui)). Also, just like [Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk), its apps start instantly and have a small memory footprint. [LibUI](https://github.com/kojix2/LibUI) is a promising new GUI toolkit that might prove quite worthy in the future.
28
28
 
29
+ Note that the new [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) is supporting the new wxruby3 binding for wxWidgets, which offers native GUI support just like LibUI, but with a mature toolkit. If you need to build more serious native GUI apps and prefer CRuby over JRuby, then [Glimmer DSL for WX](https://github.com/AndyObtiva/glimmer-dsl-wx) could be the best option for that.
30
+
29
31
  [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) 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:
30
32
  - [Declarative DSL syntax](#glimmer-gui-dsl-concepts) that visually maps to the GUI control hierarchy
31
33
  - [Convention over configuration](#smart-defaults-and-conventions) via smart defaults and automation of low-level details
@@ -466,7 +468,7 @@ gem install glimmer-dsl-libui
466
468
  Or install via Bundler `Gemfile`:
467
469
 
468
470
  ```ruby
469
- gem 'glimmer-dsl-libui', '~> 0.12.8'
471
+ gem 'glimmer-dsl-libui', '~> 0.13.0'
470
472
  ```
471
473
 
472
474
  Test that installation worked by running the [Glimmer Meta-Example](#examples):
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.8
1
+ 0.13.0
@@ -17,16 +17,14 @@ class ButtonCounter
17
17
 
18
18
  body {
19
19
  window('Hello, Button!', 190, 20) {
20
- vertical_box {
21
- button {
22
- # data-bind button text to @counter count, converting to string on read from model.
23
- text <= [@counter, :count, on_read: ->(count) {"Count: #{count}"}]
24
-
25
- on_clicked do
26
- # This change will automatically propagate to button text through data-binding above
27
- @counter.count += 1
28
- end
29
- }
20
+ button {
21
+ # data-bind button text to @counter count, converting to string on read from model.
22
+ text <= [@counter, :count, on_read: ->(count) {"Count: #{count}"}]
23
+
24
+ on_clicked do
25
+ # This count change will automatically propagate to button text through data-binding above
26
+ @counter.count += 1
27
+ end
30
28
  }
31
29
  }
32
30
  }
Binary file
@@ -42,23 +42,28 @@ module Glimmer
42
42
  alias selected= selected
43
43
  alias set_selected selected
44
44
 
45
- def items(*values)
46
- values = values.first if values.first.is_a?(Array)
47
- if values.empty?
48
- @values
45
+ def items(*item_values)
46
+ item_values = item_values.first if item_values.first.is_a?(Array)
47
+ if item_values.empty?
48
+ @items
49
49
  else
50
- @values = values
51
- @values.each { |value| append value }
50
+ @items = item_values
51
+ clear
52
+ @items.each { |item| append(item) }
52
53
  end
53
54
  end
54
55
  alias set_items items
55
56
  alias items= items
56
57
 
57
- def selected_item(value = nil)
58
- if value.nil?
59
- items[selected]
58
+ def selected_item(item_value = nil)
59
+ if item_value.nil?
60
+ if selected == -1 # no value selected (unselected)
61
+ nil
62
+ else
63
+ items[selected]
64
+ end
60
65
  else
61
- self.selected = items.index(value)
66
+ self.selected = items.index(item_value)
62
67
  end
63
68
  end
64
69
  alias set_selected_item selected_item
@@ -28,19 +28,19 @@ module Glimmer
28
28
  #
29
29
  # Follows the Proxy Design Pattern
30
30
  class EditableComboboxProxy < ControlProxy
31
- def items(*values)
32
- values = values.first if values.first.is_a?(Array)
33
- if values.empty?
34
- @values
31
+ def items(*item_values)
32
+ item_values = item_values.first if item_values.first.is_a?(Array)
33
+ if item_values.empty?
34
+ @items
35
35
  else
36
- @values ||= []
37
- values.each do |value|
38
- unless @values.include?(value)
36
+ @items ||= []
37
+ item_values.each do |value|
38
+ unless @items.include?(value)
39
39
  append(value)
40
- @values << value
40
+ @items << value
41
41
  end
42
42
  end
43
- @values
43
+ @items
44
44
  end
45
45
  end
46
46
  alias set_items items
data/lib/glimmer/libui.rb CHANGED
@@ -195,7 +195,7 @@ module Glimmer
195
195
  end
196
196
 
197
197
  def x11_colors
198
- require 'color'
198
+ require 'color/rgb/colors'
199
199
  Color::RGB.constants.reject {|c| c.to_s.upcase == c.to_s}.map(&:to_s).map(&:underscore).map(&:to_sym)
200
200
  end
201
201
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.8
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: glimmer
@@ -116,16 +115,22 @@ dependencies:
116
115
  name: color
117
116
  requirement: !ruby/object:Gem::Requirement
118
117
  requirements:
119
- - - "~>"
118
+ - - ">="
120
119
  - !ruby/object:Gem::Version
121
- version: '1.8'
120
+ version: 2.0.0
121
+ - - "<"
122
+ - !ruby/object:Gem::Version
123
+ version: 3.0.0
122
124
  type: :runtime
123
125
  prerelease: false
124
126
  version_requirements: !ruby/object:Gem::Requirement
125
127
  requirements:
126
- - - "~>"
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 2.0.0
131
+ - - "<"
127
132
  - !ruby/object:Gem::Version
128
- version: '1.8'
133
+ version: 3.0.0
129
134
  - !ruby/object:Gem::Dependency
130
135
  name: rake
131
136
  requirement: !ruby/object:Gem::Requirement
@@ -348,18 +353,18 @@ dependencies:
348
353
  version: 0.7.0
349
354
  description: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
350
355
  Development Cross-Platform Native GUI Library) - Winner of Fukuoka Ruby Award Competition
351
- 2022 Special Award (http://www.digitalfukuoka.jp/topics/187?locale=ja) - No need
352
- to pre-install any prerequisites. Just install the gem and have cross-platform native
353
- GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims to provide
354
- declarative DSL syntax that visually maps to GUI control hierarchy, convention over
355
- configuration via smart defaults, automation of low-level details, requiring the
356
- least amount of syntax possible to build GUI, bidirectional data-binding, custom
356
+ 2022 Special Award (https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html)
357
+ - No need to pre-install any prerequisites. Just install the gem and have cross-platform
358
+ native GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims
359
+ to provide declarative DSL syntax that visually maps to GUI control hierarchy, convention
360
+ over configuration via smart defaults, automation of low-level details, requiring
361
+ the least amount of syntax possible to build GUI, bidirectional data-binding, custom
357
362
  control/window support, and application/gem/window/control scaffolding. If you liked
358
363
  Shoes, You'll love Glimmer!
359
364
  email: andy.am@gmail.com
360
365
  executables:
361
- - glimmer
362
366
  - girb
367
+ - glimmer
363
368
  extensions: []
364
369
  extra_rdoc_files:
365
370
  - CHANGELOG.md
@@ -630,7 +635,6 @@ homepage: http://github.com/AndyObtiva/glimmer-dsl-libui
630
635
  licenses:
631
636
  - MIT
632
637
  metadata: {}
633
- post_install_message:
634
638
  rdoc_options: []
635
639
  require_paths:
636
640
  - lib
@@ -646,8 +650,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
646
650
  - !ruby/object:Gem::Version
647
651
  version: '0'
648
652
  requirements: []
649
- rubygems_version: 3.4.19
650
- signing_key:
653
+ rubygems_version: 3.6.7
651
654
  specification_version: 4
652
655
  summary: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
653
656
  Development Cross-Platform Native GUI Library)