glimmer-dsl-libui 0.11.7 → 0.11.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/LICENSE.txt +1 -1
  4. data/README.md +83 -14
  5. data/VERSION +1 -1
  6. data/bin/girb +1 -1
  7. data/bin/girb_runner.rb +1 -1
  8. data/bin/glimmer +1 -1
  9. data/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md +1 -1
  10. data/docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md +13 -689
  11. data/examples/basic_area.rb +3 -5
  12. data/examples/basic_area2.rb +6 -8
  13. data/examples/basic_area3.rb +5 -7
  14. data/examples/basic_area4.rb +8 -10
  15. data/examples/basic_table_button.rb +20 -22
  16. data/examples/basic_table_button2.rb +13 -15
  17. data/examples/basic_table_checkbox.rb +17 -19
  18. data/examples/basic_table_checkbox_text.rb +17 -19
  19. data/examples/basic_table_color.rb +8 -10
  20. data/examples/basic_table_color2.rb +7 -9
  21. data/examples/basic_table_color3.rb +7 -9
  22. data/examples/basic_table_image_text.rb +6 -8
  23. data/examples/basic_table_image_text2.rb +6 -8
  24. data/examples/basic_table_image_text3.rb +6 -8
  25. data/examples/date_time_picker.rb +17 -17
  26. data/examples/date_time_picker2.rb +5 -13
  27. data/examples/lazy_table.rb +8 -10
  28. data/examples/lazy_table2.rb +8 -10
  29. data/examples/lazy_table3.rb +8 -10
  30. data/examples/lazy_table4.rb +8 -10
  31. data/examples/simple_notepad.rb +1 -7
  32. data/examples/tetris/model/block.rb +1 -1
  33. data/examples/tetris/model/game.rb +1 -1
  34. data/examples/tetris/model/past_game.rb +1 -1
  35. data/examples/tetris/model/tetromino.rb +1 -1
  36. data/examples/tetris.rb +1 -1
  37. data/examples/tic_tac_toe/board.rb +1 -1
  38. data/examples/tic_tac_toe/cell.rb +1 -1
  39. data/glimmer-dsl-libui.gemspec +0 -0
  40. data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
  41. data/lib/glimmer/dsl/libui/content_expression.rb +2 -1
  42. data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
  43. data/lib/glimmer/dsl/libui/custom_control_expression.rb +1 -1
  44. data/lib/glimmer/dsl/libui/custom_shape_expression.rb +1 -1
  45. data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
  46. data/lib/glimmer/dsl/libui/dsl.rb +1 -1
  47. data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
  48. data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
  49. data/lib/glimmer/dsl/libui/observe_expression.rb +2 -1
  50. data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
  51. data/lib/glimmer/dsl/libui/open_folder_expression.rb +1 -1
  52. data/lib/glimmer/dsl/libui/operation_expression.rb +1 -1
  53. data/lib/glimmer/dsl/libui/property_expression.rb +1 -1
  54. data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
  55. data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
  56. data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
  57. data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
  58. data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
  59. data/lib/glimmer/fiddle_consumer.rb +1 -1
  60. data/lib/glimmer/libui/attributed_string.rb +1 -1
  61. data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
  62. data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
  63. data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
  64. data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
  65. data/lib/glimmer/libui/control_proxy/box.rb +1 -1
  66. data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
  67. data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
  68. data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
  69. data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
  70. data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
  71. data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
  72. data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
  73. data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
  74. data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
  75. data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
  76. data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
  77. data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
  78. data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
  79. data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
  80. data/lib/glimmer/libui/control_proxy/column.rb +1 -1
  81. data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
  82. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
  83. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
  84. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
  85. data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
  86. data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
  87. data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
  88. data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
  89. data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
  90. data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
  91. data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
  92. data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
  93. data/lib/glimmer/libui/control_proxy/form_proxy.rb +1 -1
  94. data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
  95. data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
  96. data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
  97. data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
  98. data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
  99. data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
  100. data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
  101. data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
  102. data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
  103. data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -1
  104. data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
  105. data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
  106. data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
  107. data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
  108. data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
  109. data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
  110. data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
  111. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
  112. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
  113. data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
  114. data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
  115. data/lib/glimmer/libui/control_proxy/path_proxy.rb +1 -1
  116. data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
  117. data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
  118. data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
  119. data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
  120. data/lib/glimmer/libui/control_proxy/table_proxy.rb +6 -1
  121. data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
  122. data/lib/glimmer/libui/control_proxy/transformable.rb +8 -3
  123. data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
  124. data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
  125. data/lib/glimmer/libui/control_proxy.rb +3 -2
  126. data/lib/glimmer/libui/custom_control/code_area.rb +1 -1
  127. data/lib/glimmer/libui/custom_control/refined_table.rb +1 -1
  128. data/lib/glimmer/libui/custom_control.rb +1 -1
  129. data/lib/glimmer/libui/custom_shape.rb +1 -1
  130. data/lib/glimmer/libui/custom_window.rb +1 -1
  131. data/lib/glimmer/libui/data_bindable.rb +1 -1
  132. data/lib/glimmer/libui/parent.rb +1 -1
  133. data/lib/glimmer/libui/shape/arc.rb +1 -1
  134. data/lib/glimmer/libui/shape/bezier.rb +1 -1
  135. data/lib/glimmer/libui/shape/circle.rb +1 -1
  136. data/lib/glimmer/libui/shape/figure.rb +1 -1
  137. data/lib/glimmer/libui/shape/line.rb +1 -1
  138. data/lib/glimmer/libui/shape/polybezier.rb +1 -1
  139. data/lib/glimmer/libui/shape/polygon.rb +1 -1
  140. data/lib/glimmer/libui/shape/polyline.rb +1 -1
  141. data/lib/glimmer/libui/shape/rectangle.rb +1 -1
  142. data/lib/glimmer/libui/shape/square.rb +1 -1
  143. data/lib/glimmer/libui/shape.rb +3 -3
  144. data/lib/glimmer/libui.rb +1 -1
  145. data/lib/glimmer/rake_task/package.rb +1 -1
  146. data/lib/glimmer/rake_task/scaffold.rb +1 -1
  147. data/lib/glimmer/rake_task.rb +1 -1
  148. data/lib/glimmer-dsl-libui.rb +1 -1
  149. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07dbccff31a389edf42d2fa69ae2ef9b9542d2117d01dfdb50eb586ebc76306c
4
- data.tar.gz: ba4cd480c791257bbbf762e1dd96dff5ab0a04b152ff6c65e4eaf02acc6808e5
3
+ metadata.gz: fdab64b2358ff1c023582f4a43a9836f40ca6ec416da1c5a2cee53e28292aa4b
4
+ data.tar.gz: ee871301742d88957411aa4dd106b5a8bc27fe3635db6015d3e7a523b4f0348c
5
5
  SHA512:
6
- metadata.gz: 6cfdf98cce4e5a8b51abdef7ed0e030314ec580f454897383189140ad01c81be98f1e134422a5e9ca8fd48ee6b96153d595935cbc1b39133c98da20f8e8122e0
7
- data.tar.gz: 4b6d53753335cdfad880df26cd6fdc2affa537a101d73ff6d833f2f050fcb0ab24943423ccbd8b08aca9c5c8a063997cb0f43f9731bad3d1eb55fcf92de11182
6
+ metadata.gz: 27c0c11c786b9d0c3cefaff54f1edb7a23ab1dd9e01ff5e2a29a36495aec1948cf6b522150e3b6fe62fa466eaf700d4bd36fac797b942ca3dbab0834aa3f5703
7
+ data.tar.gz: 9ac24bfb2892bc1c1ea2fa895e8718e578ca9b56c06dcf0c8028a11424dc414cf505da6b63fb28bd0a537eb0458996eb3cbfe56b932ce71bca0ea90b1eee6201
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.11.9
4
+
5
+ - Support Content Data-Binding to multiple model attributes via `computed_by` option (e.g. `content(@game, :scale, computed_by: [:width, :height])` or `content(@game, computed_by: [:scale, :width, :height])` will rebuild content on changes to `:scale`, `:width`, or `:height`)
6
+
7
+ ## 0.11.8
8
+
9
+ - Fix issue with applying a `transform` inside a `Glimmer::LibUI::Application`, `Glimmer::LibUI::CustomControl`, `Glimmer::LibUI::CustomWindow`, or `Glimmer::LibUI::CustomShape` (it otherwise worked when using Glimmer GUI DSL in top-level object)
10
+ - Refactor/simplify examples by removing unnecessary `vertical_box`/`horizontal_box` uses
11
+
3
12
  ## 0.11.7
4
13
 
5
14
  - Fix issue with `table` `checkbox_text_color_column` checkbox edits not working
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021-2023 Andy Maleh
1
+ Copyright (c) 2021-2024 Andy Maleh
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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.11.7
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.11.8
2
2
  ## Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library ([Fukuoka Award Winning](http://www.digitalfukuoka.jp/topics/187?locale=ja))
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)
@@ -31,7 +31,7 @@ The main trade-off in using [Glimmer DSL for LibUI](https://rubygems.org/gems/gl
31
31
  - [Custom Component](#custom-components) support (Custom Controls, Custom Windows, and Custom Shapes), including external Ruby gems (e.g. [Graphs and Charts](https://github.com/AndyObtiva/glimmer-libui-cc-graphs_and_charts))
32
32
  - [Bidirectional/Unidirectional Data-Binding](#data-binding) to declaratively wire and automatically synchronize GUI Views with Models
33
33
  - [Scaffolding](#scaffold-application) for new custom windows/controls, apps, and gems
34
- - [Far Future Plan] Native-Executable packaging on Mac, Windows, and Linux.
34
+ - [Far Future Plan] Native-Executable [packaging](#packaging) on Mac, Windows, and Linux.
35
35
 
36
36
  Hello, World!
37
37
 
@@ -431,7 +431,8 @@ Learn more about the differences between various [Glimmer](https://github.com/An
431
431
  - [RubyCrumbler](#rubycrumbler)
432
432
  - [Rubio-Radio](#rubio-radio)
433
433
  - [PMV Calc](#pmv-calc)
434
- - [Process](#process)
434
+ - [Design Principles](#design-principles)
435
+ - [Glimmer Process](#glimmer-process)
435
436
  - [Resources](#resources)
436
437
  - [Help](#help)
437
438
  - [Issues](#issues)
@@ -444,6 +445,8 @@ Learn more about the differences between various [Glimmer](https://github.com/An
444
445
 
445
446
  ## Setup
446
447
 
448
+ Note: the newest Ruby 3.3 is not fully supported yet.
449
+
447
450
  Install [glimmer-dsl-libui](https://rubygems.org/gems/glimmer-dsl-libui) gem directly into a [maintained Ruby version](https://www.ruby-lang.org/en/downloads/):
448
451
 
449
452
  ```
@@ -453,7 +456,7 @@ gem install glimmer-dsl-libui
453
456
  Or install via Bundler `Gemfile`:
454
457
 
455
458
  ```ruby
456
- gem 'glimmer-dsl-libui', '~> 0.11.7'
459
+ gem 'glimmer-dsl-libui', '~> 0.11.8'
457
460
  ```
458
461
 
459
462
  Test that installation worked by running the [Glimmer Meta-Example](#examples):
@@ -485,7 +488,7 @@ Afterwards, to access the Glimmer GUI DSL:
485
488
 
486
489
  You may learn more about the different options above with basic examples in the following subsections: [Experimentation Usage](#experimentation-usage), [Prototyping Usage](#prototyping-usage), [Serious Usage](#serious-usage).
487
490
 
488
- If you are new to [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) (beginner), after going through the subsections below, check out the RubyConf 2022 talk ["Building Native GUI Apps in Ruby"](https://andymaleh.blogspot.com/2023/02/rubyconf-2022-talk-video-for-building.html), [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts), [Glimmer Command](#glimmer-command) (just the basics, how to run an app, and how to run examples to start), [Girb](#girb-glimmer-irb) and [Examples](#examples) to quickly learn through copy/paste. It is very important for beginners to go through all the [Examples](#examples) from the most basic to the most advanced while reading the README topics that relate to the examples. Alternatively, beginners can learn from the RubyConf 2023 workshop ["How To Build Desktop Applications in Ruby"](https://github.com/AndyObtiva/how-to-build-desktop-applications-in-ruby), which includes 27 step-by-step exercises. You may refer to the [API](#api) once you have gotten your feet wet with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) and need a more detailed reference.
491
+ If you are new to [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) (beginner), after going through the subsections below, check out the RubyConf 2022 talk ["Building Native GUI Apps in Ruby"](https://andymaleh.blogspot.com/2023/02/rubyconf-2022-talk-video-for-building.html), [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts), [Glimmer Style Guide](#glimmer-style-guide), [Glimmer Command](#glimmer-command) (just the basics, how to run an app, and how to run examples to start), [Girb](#girb-glimmer-irb) and [Examples](#examples) to quickly learn through copy/paste. It is very important for beginners to go through all the [Examples](#examples) from the most basic to the most advanced while reading the README topics that relate to the examples. Alternatively, beginners can learn from the RubyConf 2023 workshop ["How To Build Desktop Applications in Ruby"](https://github.com/AndyObtiva/how-to-build-desktop-applications-in-ruby), which includes 27 step-by-step exercises. You may refer to the [API](#api) once you have gotten your feet wet with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui) and need a more detailed reference.
489
492
 
490
493
  If you encounter any issues with the documentation, get stuck with code you do not understand, or notice some out-of-date information, you may contact the project maintainers on the [Glimmer Gitter Chat](https://app.gitter.im/#/room/#AndyObtiva_glimmer:gitter.im). Also, this could be your opportunity to be a good steward of Open-Source Software by contributing a documentation fix in a GitHub Pull Request or reporting a GitHub Issue at least.
491
494
 
@@ -660,7 +663,7 @@ Mac | Windows | Linux
660
663
 
661
664
  Application scaffolding enables automatically generating the directories/files of a new desktop GUI application that follows the MVC architecture and can be packaged as a Ruby gem that includes an executable script for running the app conveniently. It also ensures that software engineers follow the recommended Glimmer DSL for LibUI conventions and best practices. Application Scaffolding greatly improves software engineering productivity when building desktop applications with [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-libui).
662
665
 
663
- Application Scaffolding relies on the juwelier Ruby gem, which expects a local Git config of [`user.name`](https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer) (git config --global user.name "FirstName LastName") and `github.user` (`git config --global github.user githubusername`).
666
+ Application Scaffolding relies on the juwelier Ruby gem, which expects a local Git config of [`user.name`](https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git#setting-your-git-username-for-every-repository-on-your-computer) (git config --global user.name "FirstName LastName") and `github.user` (`git config --global github.user githubusername`).
664
667
 
665
668
  Scaffold Glimmer DSL for LibUI application with this command:
666
669
 
@@ -1663,7 +1666,51 @@ form {
1663
1666
  }
1664
1667
  ```
1665
1668
 
1666
- The form above will only display fields for a model's customizable attributes, so if they change, the form content will change too. Learn more at the [Dynamic Form](/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md#dynamic-form) example.
1669
+ The form above will only display fields for a model's customizable attributes, so if they change, the form content will change too.
1670
+
1671
+ If you need to rebuild (re-render) content upon changes to multiple model attributes, you can use the `computed_by` option.
1672
+
1673
+ Example:
1674
+
1675
+ ```ruby
1676
+ form {
1677
+ stretchy false
1678
+
1679
+ content(@user, :address, computed_by: [:street, :city, :zipcode]) {
1680
+ @user.address_attributes.each do |attribute|
1681
+ entry {
1682
+ label attribute.to_s.split('_').map(&:capitalize).join(' ')
1683
+ text <=> [@user, attribute]
1684
+ }
1685
+ end
1686
+ }
1687
+ }
1688
+ ```
1689
+
1690
+ Now, the content block will get called when changes occur to any of `User` `address` ,`street`, `city`, or `zipcode`.
1691
+
1692
+ If you do not have a main attribute that is computed by other attributes, you can leave the main attribute out while using `computed_by`.
1693
+
1694
+ Example:
1695
+
1696
+ ```ruby
1697
+ form {
1698
+ stretchy false
1699
+
1700
+ content(@user, computed_by: [:street, :city, :zipcode]) {
1701
+ @user.address_attributes.each do |attribute|
1702
+ entry {
1703
+ label attribute.to_s.split('_').map(&:capitalize).join(' ')
1704
+ text <=> [@user, attribute]
1705
+ }
1706
+ end
1707
+ }
1708
+ }
1709
+ ```
1710
+
1711
+ Now, the content block will get called (rerendered) when changes occur to any of `User` `street`, `city`, or `zipcode`.
1712
+
1713
+ Learn more about Content Data-Binding at the [Dynamic Form](/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md#dynamic-form) example.
1667
1714
 
1668
1715
  **Property**: Control properties may be declared inside keyword blocks with lower-case underscored name followed by property value args (e.g. `title "hello world"` inside `group`). Behind the scenes, properties correspond to `LibUI.control_set_property` methods.
1669
1716
 
@@ -1743,6 +1790,9 @@ window('hello world', 300, 200) {
1743
1790
  end
1744
1791
  }.show
1745
1792
  ```
1793
+
1794
+ Make sure that you follow the [Glimmer Style Guide](#glimmer-style-guide) when writing any Glimmer GUI DSL code.
1795
+
1746
1796
  ## API
1747
1797
 
1748
1798
  Any control returned by a [Glimmer GUI DSL](#glimmer-gui-dsl-concepts) keyword declaration can be introspected for its properties and updated via object-oriented attributes (standard Ruby `attr`/`attr=` or `set_attr`).
@@ -2141,6 +2191,8 @@ The `area` control is a canvas-like control for drawing paths that can be used i
2141
2191
 
2142
2192
  Note that when nesting an `area` directly underneath `window` (without a layout control like `vertical_box`), it is automatically reparented with `vertical_box` in between the `window` and `area` since it would not show up on Linux otherwise.
2143
2193
 
2194
+ Also, note that Canvas graphics performance is a bit slow today due to the Ruby LibUI binding making Canvas drawing calls with FFI. There is currently work under way to re-implement the Canvas drawing calls with C Native Extensions, which should speed up performance by 10x-100x once fully implemented. Still, if the `area` control is needed to paint simple or mostly static graphics that do not change much (not updating more than once a second), then current `area` performance should be more than fast enough for those needs.
2195
+
2144
2196
  Here is an example of a declarative `area` with a stable path (you may copy/paste in [`girb`](#girb-glimmer-irb)):
2145
2197
 
2146
2198
  ```ruby
@@ -3786,20 +3838,25 @@ To learn more about the [LibUI](https://github.com/kojix2/LibUI) API exposed thr
3786
3838
 
3787
3839
  ## Packaging
3788
3840
 
3789
- I am documenting options for packaging, which I have not tried myself, but figured they would still be useful to add to the README.md until I can expand further effort into supporting packaging.
3841
+ If you are building a productivity tool to help with your work, then packaging the app as a Ruby gem would be a good enough solution (already supported via [Application Scaffolding](#scaffold-application)). Otherwise, I am documenting options for native executable packaging, which I have not tried myself, but figured they would still be useful to add to the README.md until I can expand further effort into supporting packaging.
3790
3842
 
3791
- For Windows, the [LibUI](https://github.com/kojix2/LibUI) project recommends [OCRA](https://github.com/larsch/ocra) (One-Click Ruby Application), which builds Windows executables from Ruby source. And, there is a newer fork of the project that supports newer versions of Ruby called [OCRAN](https://github.com/Largo/ocran).
3843
+ For Windows, [OCRAN](https://github.com/Largo/ocran) can build Windows executables from Ruby source code. It is a new maintained alternative version of [OCRA](https://github.com/larsch/ocra) (One-Click Ruby Application).
3792
3844
 
3793
- For Mac, consider [Platypus](https://github.com/sveinbjornt/Platypus) (builds a native Mac app from a Ruby script)
3845
+ For Mac, you can consider [Platypus](https://github.com/sveinbjornt/Platypus) (builds a native Mac app from a Ruby script) by following the tutorial ["Create a MacOS desktop application with pure Ruby"](https://dev.to/josephschito/create-macos-application-desktop-with-pure-ruby-tutorial-36io) by Joseph Schito.
3794
3846
 
3795
3847
  For Linux, simply package your app as a [Ruby Gem](https://guides.rubygems.org/what-is-a-gem/) and [build rpm package from Ruby Gem](https://www.redpill-linpro.com/sysadvent/2015/12/07/building-rpms-from-gems.html) or [build deb package from Ruby Gem](https://openpreservation.org/blogs/building-debian-package-ruby-program/).
3796
3848
 
3797
3849
  Also, there is a promising project called [ruby-packer](https://github.com/pmq20/ruby-packer) that supports all platforms.
3798
3850
 
3799
- Last but not least, Ruby recently supported WASM, including the ability to [package a Ruby application as a WASI application](https://github.com/ruby/ruby.wasm#quick-example-how-to-package-your-ruby-application-as-a-wasi-application).
3851
+ One more thing to note is that Ruby recently supported WASM, including the ability to [package a Ruby application as a WASI application](https://github.com/ruby/ruby.wasm#quick-example-how-to-package-your-ruby-application-as-a-wasi-application). You can explore combining that with [wasm2native](https://github.com/vshymanskyy/wasm2native) to produce cross-platform native executables.
3852
+
3853
+ Otherwise, if you really need comprehensive cross-platform native executable packaging support, consider using [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt), which does offer [cross-platform packaging support](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) for apps as MSI/EXE on Windows, APP/DMG/PKG on Mac, and DEB/RPM on Linux out of the box.
3854
+
3800
3855
 
3801
3856
  ## Glimmer Style Guide
3802
3857
 
3858
+ The code of the Glimmer GUI DSL is not standard imperative Ruby code because it represents a declarative Domain Specific Language for describing the hierarchical structure of a Graphical User Interface, meaning a language embedded within Ruby that is slightly separate from Ruby. So, it is important that it has a declarative style that helps Software Engineers focus on the visual aspect of the Graphical User Interface in a highly productive manner. As such, multi-line blocks intentionally do not use imperative words like `do; end` that slow readability down, yet the declarative `{}` style that helps give a quick visual view of GUI component nesting at a glance. However, MVC Views are observed for changes by listeners that then invoke imperative logic in Models, so listener multi-line blocks do have the `do; end` style to clearly distinguish imperative code from declarative code in Views. In summary, the Ruby Style Guide is not applicable when writing Glimmer GUI DSL code. Software Engineers must adhere to the Glimmer Style Guide for View code instead to cater to the style requirements of both declarative DSL code and imperative Ruby code.
3859
+
3803
3860
  **1 - Control arguments are always wrapped by parentheses.**
3804
3861
 
3805
3862
  Example:
@@ -4224,13 +4281,25 @@ This is built as an exploratory software prototype by [Ari Brown](https://github
4224
4281
 
4225
4282
  ### Adamantite
4226
4283
 
4227
- A local password manager written in Ruby (closed source software):
4284
+ A local password manager written in Ruby:
4228
4285
 
4229
4286
  https://rubygems.org/gems/adamantite
4230
4287
 
4231
4288
  ![Adamantite password manager](/images/glimmer-dsl-libui-mac-application-adamantite.png)
4232
4289
 
4233
- ## Process
4290
+ ## Design Principles
4291
+
4292
+ - The Ruby Way (including TIMTOWTDI: There Is More Than One Way To Do It)
4293
+ - Requiring the least amount of syntax possible to build GUI (Graphical User Interface)
4294
+ - Declarative syntax that visually maps to the GUI control hierarchy
4295
+ - Ability to mix declarative and imperative code conveniently without needing awkward & verbose technologies (e.g. no XML, HTML, ERB scriptlets, JSX)
4296
+ - Computers serve Software Engineers (not Software Engineers serve Computers)
4297
+ - Think only about real world concepts directly relevant to the GUI and interacting with it (no weird non-real-world irrelevant concepts like hooks/effects/immutability)
4298
+ - The Rails Way Convention over Configuration via smart defaults and automation of low-level details
4299
+ - Modular Software Design (e.g. support for Components)
4300
+ - No premature optimizations
4301
+
4302
+ ## Glimmer Process
4234
4303
 
4235
4304
  [Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)
4236
4305
 
@@ -4292,7 +4361,7 @@ Note that the latest development sometimes takes place in the [development](http
4292
4361
 
4293
4362
  [MIT](LICENSE.txt)
4294
4363
 
4295
- Copyright (c) 2021-2023 Andy Maleh
4364
+ Copyright (c) 2021-2024 Andy Maleh
4296
4365
 
4297
4366
  --
4298
4367
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.7
1
+ 0.11.9
data/bin/girb CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright (c) 2021-2023 Andy Maleh
3
+ # Copyright (c) 2021-2024 Andy Maleh
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
6
6
  # a copy of this software and associated documentation files (the
data/bin/girb_runner.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
data/bin/glimmer CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Copyright (c) 2021-2023 Andy Maleh
3
+ # Copyright (c) 2021-2024 Andy Maleh
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining
6
6
  # a copy of this software and associated documentation files (the
@@ -3015,7 +3015,7 @@ class Tetris
3015
3015
 
3016
3016
  def show_about_dialog
3017
3017
  Glimmer::LibUI.queue_main do
3018
- msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-2023 Andy Maleh')
3018
+ msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-2024 Andy Maleh')
3019
3019
  end
3020
3020
  end
3021
3021
  end