glimmer-dsl-libui 0.12.8 → 0.13.1
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +7 -5
- data/VERSION +1 -1
- data/examples/button_counter.rb +8 -10
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +15 -10
- data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +9 -9
- data/lib/glimmer/libui.rb +5 -1
- metadata +10 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e385cd77c53aa0d88ae57065031652b46a43cae650673ec5e8fb19d17f51abc
|
|
4
|
+
data.tar.gz: 28934fa1b0ba7682ce73d65671238f21b0c00de17d265df02564bb7fe8cf0488
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4284ac332f566ed15b121c088f16401949c507a8bce32406c98457ba2adb74107f5ed9a0913741017587b713a502bdf1659473ac5631c57d1fd7159515a670d5
|
|
7
|
+
data.tar.gz: 25463eca0013a0517de153bd3bf757c1e0384b0bb675741735281441d24d8cd4054ee3261bb4e27e72c57650c95ca72de73afad475b83019070c3bc8ef3523be
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
- Revert color gem to version 1.8 to maintain compatibility with Ruby versions lower than 3.2 for broader support
|
|
6
|
+
|
|
7
|
+
## 0.13.0
|
|
8
|
+
|
|
9
|
+
- Support `combobox` `items` unidirectional data-binding
|
|
10
|
+
- Update color gem to version 2
|
|
11
|
+
- Refactor/simplify examples/button_counter.rb by removing unnecessary `vertical_box` (Glimmer DSL for LibUI implicitly adds it automatically when needed)
|
|
12
|
+
- Fix issue of `combobox` `selected_item` bidirectional data-binding not working correctly like `selected` data-binding does
|
|
13
|
+
|
|
3
14
|
## 0.12.8
|
|
4
15
|
|
|
5
16
|
- 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.
|
|
2
|
-
## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](
|
|
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.1
|
|
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
|
[](http://badge.fury.io/rb/glimmer-dsl-libui)
|
|
5
5
|
[](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)**
|
|
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](
|
|
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.
|
|
471
|
+
gem 'glimmer-dsl-libui', '~> 0.13.1'
|
|
470
472
|
```
|
|
471
473
|
|
|
472
474
|
Test that installation worked by running the [Glimmer Meta-Example](#examples):
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.13.1
|
data/examples/button_counter.rb
CHANGED
|
@@ -17,16 +17,14 @@ class ButtonCounter
|
|
|
17
17
|
|
|
18
18
|
body {
|
|
19
19
|
window('Hello, Button!', 190, 20) {
|
|
20
|
-
|
|
21
|
-
button
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
}
|
data/glimmer-dsl-libui.gemspec
CHANGED
|
Binary file
|
|
@@ -42,23 +42,28 @@ module Glimmer
|
|
|
42
42
|
alias selected= selected
|
|
43
43
|
alias set_selected selected
|
|
44
44
|
|
|
45
|
-
def items(*
|
|
46
|
-
|
|
47
|
-
if
|
|
48
|
-
@
|
|
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
|
-
@
|
|
51
|
-
|
|
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(
|
|
58
|
-
if
|
|
59
|
-
|
|
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(
|
|
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(*
|
|
32
|
-
|
|
33
|
-
if
|
|
34
|
-
@
|
|
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
|
-
@
|
|
37
|
-
|
|
38
|
-
unless @
|
|
36
|
+
@items ||= []
|
|
37
|
+
item_values.each do |value|
|
|
38
|
+
unless @items.include?(value)
|
|
39
39
|
append(value)
|
|
40
|
-
@
|
|
40
|
+
@items << value
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
|
-
@
|
|
43
|
+
@items
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
alias set_items items
|
data/lib/glimmer/libui.rb
CHANGED
|
@@ -195,7 +195,11 @@ module Glimmer
|
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
def x11_colors
|
|
198
|
-
|
|
198
|
+
begin
|
|
199
|
+
require 'color/rgb/colors'
|
|
200
|
+
rescue
|
|
201
|
+
require 'color'
|
|
202
|
+
end
|
|
199
203
|
Color::RGB.constants.reject {|c| c.to_s.upcase == c.to_s}.map(&:to_s).map(&:underscore).map(&:to_sym)
|
|
200
204
|
end
|
|
201
205
|
|
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.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Maleh
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: glimmer
|
|
@@ -348,18 +347,18 @@ dependencies:
|
|
|
348
347
|
version: 0.7.0
|
|
349
348
|
description: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
|
|
350
349
|
Development Cross-Platform Native GUI Library) - Winner of Fukuoka Ruby Award Competition
|
|
351
|
-
2022 Special Award (
|
|
352
|
-
to pre-install any prerequisites. Just install the gem and have cross-platform
|
|
353
|
-
GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims
|
|
354
|
-
declarative DSL syntax that visually maps to GUI control hierarchy, convention
|
|
355
|
-
configuration via smart defaults, automation of low-level details, requiring
|
|
356
|
-
least amount of syntax possible to build GUI, bidirectional data-binding, custom
|
|
350
|
+
2022 Special Award (https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html)
|
|
351
|
+
- No need to pre-install any prerequisites. Just install the gem and have cross-platform
|
|
352
|
+
native GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims
|
|
353
|
+
to provide declarative DSL syntax that visually maps to GUI control hierarchy, convention
|
|
354
|
+
over configuration via smart defaults, automation of low-level details, requiring
|
|
355
|
+
the least amount of syntax possible to build GUI, bidirectional data-binding, custom
|
|
357
356
|
control/window support, and application/gem/window/control scaffolding. If you liked
|
|
358
357
|
Shoes, You'll love Glimmer!
|
|
359
358
|
email: andy.am@gmail.com
|
|
360
359
|
executables:
|
|
361
|
-
- glimmer
|
|
362
360
|
- girb
|
|
361
|
+
- glimmer
|
|
363
362
|
extensions: []
|
|
364
363
|
extra_rdoc_files:
|
|
365
364
|
- CHANGELOG.md
|
|
@@ -630,7 +629,6 @@ homepage: http://github.com/AndyObtiva/glimmer-dsl-libui
|
|
|
630
629
|
licenses:
|
|
631
630
|
- MIT
|
|
632
631
|
metadata: {}
|
|
633
|
-
post_install_message:
|
|
634
632
|
rdoc_options: []
|
|
635
633
|
require_paths:
|
|
636
634
|
- lib
|
|
@@ -646,8 +644,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
646
644
|
- !ruby/object:Gem::Version
|
|
647
645
|
version: '0'
|
|
648
646
|
requirements: []
|
|
649
|
-
rubygems_version: 3.
|
|
650
|
-
signing_key:
|
|
647
|
+
rubygems_version: 3.6.7
|
|
651
648
|
specification_version: 4
|
|
652
649
|
summary: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
|
|
653
650
|
Development Cross-Platform Native GUI Library)
|