Monday, March 20, 2023

Glimmer DSL for SWT

Glimmer DSL for SWT has just been released as the latest quarterly major version release with the following changes:

  • Upgrade to Eclipse SWT 4.27
  • Upgrade to JRuby

Wednesday, February 15, 2023

Announcing 2 Talks for Montreal.rb Meetup in April 2023

The next Montreal.rb meetup (April 2023) has been announced and will include 2 talks!!

Talk 1 - Rails Already Supports View Components - 30 minutes

There are several view component Ruby gems out there that were created and used by Rails developers in order to decompose application views into view components. Little did they know, Rails already supports view components!!! This talk will explain the various ways Rails already supports view components out of the box. And as part of that, it will demonstrate that the built-in Rails view component options are simpler, more Rails-idiomatic, and more conformant to the MVC pattern (Model-View-Controller). As such, they offer higher maintainability and productivity by avoiding the big great evil of Over-Engineering and NIH-Syndrome (Not Invented Here). 

Talk 2 - Internal Productivity Tooling CLI - 30 minutes 

This is a talk on Potloc's internal productivity tooling CLI (Command Line Interface), including a short demo and tour of the codebase to complement. 


P.S. I have been promoted by Mathieu Gagné to a secondary organizer of the Montreal.rb meetup group (The Montreal Ruby Programming Language Community Meetup Group). If you would like to share useful knowledge with others in the Montreal Ruby community by giving a talk, please hit me up! The only requirement is that you work in Ruby or Rails at a senior level.

Wednesday, February 01, 2023

Drum Solo Demo of Glimmer Metronome (+ Menus & Shortcuts)

I recorded a drum solo to demo Glimmer Metronome (click to see a video demo with audio)Glimmer Metronome is a Ruby-based metronome GUI app that supports different beat counts, click sounds, and tempos, including tap-based tempo calculation. It was built with Glimmer DSL for SWT using JRuby to help me with my drumming practice. Glimmer Metronome just received a new update in version 1.1.4 that adds menus and keyboard shortcuts, thus becoming more user-friendly when used via the keyboard alone. 

Here is another direct demo of Glimmer Metronome (click to see a video demo with audio).

Below is full documentation of Glimmer Metronome's features, including the new menus and keyboard shortcuts.


Friday, January 27, 2023

Glimmer Ecosystem, Glimte 3rd Party Framework, PasswordStore

Traditionally, Glimmer GUI gems have been mostly a one-sided effort, with a few 3rd party contributions here and there (like Drag and Drop support for Glimmer DSL for Tk). Well, that changes with Glimte! Glimte is a 3rd party framework built on top of Glimmer (Tk flavor) by Phaengris to facilitate following a certain variation of the MVC pattern (Model-View-Controller) called MVVM (Model-View-ViewModel). It encourages a model of programming for desktop GUI views that is similar to Rails .erb and GTK .glade files, but using the Glimmer GUI DSL in .glimmer.rb files as the view format. As such, it provides a much lighter more programmer-friendly Ruby-native replacement for HTML, ERB, and Glade. Consequently, Glimte ushers in the next era of Glimmer; that is The Glimmer Ecosystem! 

The Glimmer Ecosystem enables the democratization of the style of development followed when building Glimmer desktop applications in Ruby, among many other obvious benefits. That in turn facilitates a vision similar to the Rails vision explained by Yahuda Katz in his keynote speech at RailsConf 2014 (at which I presented too), which was borrowed from Steve Jobs. What Yahuda alluded to was that by continuously building more floors for the lower levels of a building in the form of a framework and a community of open-source projects, we enable developers to start development at higher and higher levels than they would have been able to otherwise, thus helping them leapfrog earlier ways of development in ever increasing productivity!

So, what is Glimte?

"MVVM framework based on Glimmer for creating desktop apps in Ruby / Tk" 

- Source:

Are there any apps built with Glimte?

PasswordStore - "Tk-based desktop client for the Linux password store manager"

What is pass, the Linux password manager that PasswordStore is built for?

"Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities.

pass makes managing these individual password files extremely easy. All passwords live in ~/.password-store, and pass provides some nice commands for adding, editing, generating, and retrieving passwords. It is a very short and simple shell script. It's capable of temporarily putting passwords on your clipboard and tracking password changes using git." 

Below is a full introduction to Glimte, taken straight from the GitHub project page.

Happy Glimmering!

Wednesday, January 11, 2023

Glimmer DSL for LibUI Table Lazy Loading

Glimmer DSL for LibUI 0.6.1 has been released with support for table lazy loading via Enumerator (or Enumerator::Lazy). As a result, the table control can now handle millions of rows and renders instantly without waiting for all data to be loaded given that it is loaded lazily as the user scrolls through the table. That enables applications with a lot of data (or with data that needs to be loaded/generated) to start instantly. A new example, Lazy Table (4 versions), has been included to demonstrate table lazy loading (read on to learn more about it). Of course, from a usability and user experience point of view, it might still not be a good idea to display millions of rows, yet to display only a few via pagination, like by using the Refined Table custom control that was released and blogged about a while ago.

Glimmer DSL for LibUI 0.6.0 was a final release that included many changes implemented as pre versions previously, including a new C libui version (libui-ng Nov 13, 2022), which includes some low-level fixes and new features for the libui GUI toolkit.

Change Log (both 0.6.1 & 0.6.0):

  • examples/lazy_table.rb (4 versions) table lazy loading with a million rows via Enumerator or Enumerator::Lazy to enable instant app startup time
  • Support table cell_rows implicit data-binding to a collection of models (only supported an array of arrays before in implicit data-binding)
  • Upgrade to libui Ruby gem version 0.1.0.pre.0, which includes a newer C libui alpha release (libui-ng Nov 13, 2022)
  • Support table cell_rows Enumerator or Enumerator::Lazy value to do lazy loading of data upon display of rows instead of immediate loading of all table data, thus improving performance of table initial render for very large datasets
  • Fix issue with table progress_bar_column not getting updated successfully on Windows if there were dual or triple columns before it.
  • Fix issue with table progress_bar_column not getting updated successfully on Windows if data-binding table to an array of models instead of an array of arrays
  • Fix issue with table checkbox_column checkbox editing not working in Mac by including a new C libui-ng release
  • Fix issue with table checkbox_text_column checkbox editing not working in Mac or Windows by including a new C libui-ng release
  • Update examples/basic_table_checkbox.rb to enable editing checkbox values
  • Update examples/basic_table_checkbox_text.rb to enable editing checkbox/text values
  • [final] Optimize table scrolling performance when having many rows and columns (prevent recalculation of expanded_cell_rows on every cell evaluation). Resolve: #38
  • [final] refined_table pagination: false option to disable pagination, but keep filtering.
  • [final] Fix issue with Glimmer::LibUI::interpret_color support for [r, g, b, a] Array-based colors, returning [r, g, b] only without alpha value
  • [final] Fix issue "Cannot add rows to a table that started empty": #36
  • [final] window #open method as alias to #show
  • [final] window #focused? read-only property
  • [final] Document window on_focus_changed listener
  • [final] Update examples/basic_child_window.rb to demo on_focus_changed and focused?
  • [final] open_folder support
  • [final] examples/control_gallery.rb now includes an "Open Folder" File menu item

Lazy Table example:

Lazy Table (using a well encapsulated Enumerator subclass)

Lazy Table (using a well encapsulated Enumerator::Lazy Subclass)

Glimmer on!!!