glimmer-dsl-libui 0.7.4 → 0.7.5

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: 5f7eb8d1c417de9910ff49f86592694558a3333f4840971f65be1232adf7408b
4
- data.tar.gz: 9cdf9733b7026aae945ec183ba4551ee2bbe120454c0a094c02a99bd5338069a
3
+ metadata.gz: ec43caceca7a5693e9a98278af76787a03cdfa7e259b4eafc221456f2388f1cf
4
+ data.tar.gz: 72e7b5b20c6d07ab1160d1e83c7564dea41181b538b71d73d54acb41e839f503
5
5
  SHA512:
6
- metadata.gz: 5a6c290b75e8301cadd8c837be2612dd4e653192577ea0c8f2493d4fa4a0b7198f2f8008c99d7adeef42320e5b4d86be339b37fe9ca588ee4cc9e22ad36c0a48
7
- data.tar.gz: b51a3e1e878b9adde67cc6670f682df5d7ab09a6678b8b16655fbcb0d5e3770b5119f867ea58c4b025a78e043ed56cd0309f86eccdec0b90d31c19b375a0007b
6
+ metadata.gz: b829f991b9fa34fb2ba186a022a950e45e65d13e81019ad53829b2c57b13aa7a16c10304207c6cc734015a4a5a3b44885070da15832f92f655603e925623396e
7
+ data.tar.gz: c00a6b5c543039dc64c68f5e2e3cccfad74f7b511ba6fb40aa3482e9468ea49de995dc0edb8cc924082c2cce456923a47e5d9bc406b2866be8999f6309b31925
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.7.5
4
+
5
+ - Fix [issue 46](https://github.com/AndyObtiva/glimmer-dsl-libui/issues/46) (GTK Error rendering table with zero initial elements), which happens when explicitly data-binding table cell_rows to an empty array
6
+
3
7
  ## 0.7.4
4
8
 
5
9
  - `table` `sortable` property (default: `true`) to enable automatic table sorting support when `cell_rows` is an `Array` (does not sort if `cell_rows` is a lazy enumerable)
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 LibUI 0.7.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 LibUI 0.7.5
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
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)
@@ -10,15 +10,15 @@
10
10
 
11
11
  [**(Ruby Rogues Podcast Interview - Desktop Apps in Ruby ft. Andy)**](https://andymaleh.blogspot.com/2022/05/ruby-rogues-podcast-interview-desktop.html)
12
12
 
13
- [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [LibUI](https://github.com/kojix2/LibUI) is a prerequisite-free [MRI Ruby](https://www.ruby-lang.org) desktop development 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 platform-independent native GUI that just works!
13
+ [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [LibUI](https://github.com/libui-ng/libui-ng) is a prerequisite-free [MRI Ruby](https://www.ruby-lang.org) desktop development 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 platform-independent native GUI that just works!
14
14
 
15
15
  Mac | Windows | Linux
16
16
  ----|---------|------
17
17
  ![glimmer-dsl-libui-mac-control-gallery.png](images/glimmer-dsl-libui-mac-control-gallery.png) | ![glimmer-dsl-libui-windows-control-gallery.png](images/glimmer-dsl-libui-windows-control-gallery.png) | ![glimmer-dsl-libui-linux-control-gallery.png](images/glimmer-dsl-libui-linux-control-gallery.png)
18
18
 
19
- [LibUI](https://github.com/kojix2/LibUI) is a thin [Ruby](https://www.ruby-lang.org/en/) wrapper around [libui](https://github.com/andlabs/libui) (and newer [libui-ng](https://github.com/libui-ng/libui-ng)), a relatively new C GUI library that renders native controls on every platform (similar to [SWT](https://www.eclipse.org/swt/), but without the heavy weight of the [Java Virtual Machine](https://www.java.com/en/)).
19
+ [LibUI](https://github.com/libui-ng/libui-ng) is a relatively new C GUI library that renders native controls on every platform (similar to [SWT](https://www.eclipse.org/swt/), but without the heavy weight of the [Java Virtual Machine](https://www.java.com/en/)).
20
20
 
21
- 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-ng](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 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.
21
+ 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.
22
22
 
23
23
  [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:
24
24
  - [Declarative DSL syntax](#glimmer-gui-dsl-concepts) that visually maps to the GUI control hierarchy
@@ -544,7 +544,7 @@ gem install glimmer-dsl-libui
544
544
  Or install via Bundler `Gemfile`:
545
545
 
546
546
  ```ruby
547
- gem 'glimmer-dsl-libui', '~> 0.7.4'
547
+ gem 'glimmer-dsl-libui', '~> 0.7.5'
548
548
  ```
549
549
 
550
550
  Test that installation worked by running the [Meta-Example](#examples):
@@ -851,6 +851,11 @@ There are other properties that `table` supports:
851
851
  - `selection` (`Integer` or `Array` of `Integer`s): a single `Integer` row index for `:one` and `:zero_or_one` selection modes, or an `Array` of `Integer` row indexes if selection mode is `:zero_or_many`
852
852
  - `header_visible` (Boolean): shows or hides column headers
853
853
  - `sortable` (Boolean) [default: `true`]: enables automatic table sorting support
854
+ - `on_changed {|row, type, row_data| ...}`: triggered upon a change to a row that happens outside the table in the model
855
+ - `on_edited {|row, row_data| ...}`: triggered upon a change to a row that happens in the table GUI through editing.
856
+ - `on_row_clicked {|table, row| }`: triggered upon clicking a table row
857
+ - `on_row_double_clicked {|table, row| }`: triggered upon double-clicking a table row
858
+ - `on_selection_changed {|table, selection, added_selection, removed_selection| }`: triggered upon selecting a table row
854
859
 
855
860
  To handle `table` sorting manually, the following can be set inside a table column:
856
861
  - `sort_indicator` (`Symbol`): sets sort indicator to ascending or descending with the value being `:ascending`, `:descending`, `:asc`, `:desc`, `:a`, or `:d`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.4
1
+ 0.7.5
@@ -1506,6 +1506,8 @@ Mac | Windows | Linux
1506
1506
 
1507
1507
  ## Basic Table Selection
1508
1508
 
1509
+ [examples/basic_table_selection.rb](/examples/basic_table_selection.rb)
1510
+
1509
1511
  Run with this command from the root of the project if you cloned the project:
1510
1512
 
1511
1513
  ```
@@ -1524,14 +1526,18 @@ ruby -r glimmer-dsl-libui -e "require 'examples/basic_table_selection'"
1524
1526
  ![glimmer-dsl-libui-mac-basic-table-selection-none.png](/images/glimmer-dsl-libui-mac-basic-table-selection-none.png)
1525
1527
  ![glimmer-dsl-libui-mac-basic-table-selection-header-not-visible.png](/images/glimmer-dsl-libui-mac-basic-table-selection-header-not-visible.png)
1526
1528
 
1527
- Version 1 (without data-binding):
1529
+ Version 1 (automatic sorting and data-binding):
1528
1530
 
1529
1531
  [examples/basic_table_selection.rb](/examples/basic_table_selection.rb)
1530
1532
 
1531
- Version 2 (with data-binding):
1533
+ Version 2 (custom sorting and data-binding):
1532
1534
 
1533
1535
  [examples/basic_table_selection2.rb](/examples/basic_table_selection2.rb)
1534
1536
 
1537
+ Version 3 (custom sorting without data-binding):
1538
+
1539
+ [examples/basic_table_selection3.rb](/examples/basic_table_selection3.rb)
1540
+
1535
1541
  ## Basic Area
1536
1542
 
1537
1543
  [examples/basic_area.rb](/examples/basic_area.rb)
Binary file
@@ -634,6 +634,7 @@ module Glimmer
634
634
  end
635
635
  end
636
636
  @cell_rows_observer_registration = @cell_rows_observer.observe(self, :cell_rows, recursive: true, ignore_frozen: true, attribute_writer_type: [:attribute=, :set_attribute])
637
+ @cell_rows_observer.call
637
638
  end
638
639
 
639
640
  def apply_windows_fix
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2023-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer