Sunday, December 31, 2023

Glimmer DSL for SWT 4.30.0.0

Glimmer DSL for SWT 4.30.0.0 (JRuby Desktop Development Cross-Platform Native GUI Framework) is the quarterly major release that supports a new version of Eclipse SWT (version 4.30, released in December 2023).

Below is a screenshot of the Hello, Code Text! sample, which is written in Ruby using Glimmer DSL for SWT)

Change Log for glimmer-dsl-swt gem version 4.30.0.0:

  • Upgrade to SWT 4.30
  • Upgrade to JDK 21
  • Upgrade to JRuby 9.4.5.0 with Ruby 3.1 support
  • Upgrade to Glimmer 2.7.4
  • Avoid loading the entirety of facets when scaffolding or listing gems (speeding up performance of glimmer list and scaffold commands)
  • Fix Mandelbrot Fractal sample on Windows as it crashes if run from within VirtualBox due to attempting to access Concurrent.physical_processor_count, which has been changed to Concurrent.processor_count
  • Fix dimensions of Weather sample on Linux

More Sample Screenshots:




Happy New Year and Happy Glimmering!


2 comments:

Ricardo P said...

Longtime ruby user for writing scripts, never thought I would use it for a program with a GUI. Love it!

I created a GUI and used the print widget, but the size of the GUI on the print out is tiny. Checked your samples and they also printed tiny (unreadable). Is there a setting that would fix that, or something wrong with my set up? I am using Windows 11.

Thank you.

Andy Maleh said...

Ricardo, I am sorry I didn't see your comment till now (May 2, 2024). It is normally better to reach me on the Glimmer Gitter chat if you have support questions related to Glimmer GUI libraries.

There are 2 ways to print, the built-in automatic way, which assumes everything fits on one page (I assume that is the one you tried), and the custom manual way, which gives you more control over how you size things.

The automatic way is demonstrated in Hello, Print!:

Hello, Print! code

The custom way is demonstrated in Hello, Print Dialog!:

Hello, Print Dialog! code

To customize things the manual way, you have to study the SWT Printer class:

Printer API

And, SWT PrintDialog class:

PrintDialog API

As well as any other related classes like GC:

GC API

And, Image:

Image API

You would have to tweak the code in Hello, Print Dialog! to fit your needs.

For example, GC, has 2 drawImage methods, one that draws an image as is, and another that scales the image as it is drawing it. It is possible that you need to use the 2nd version (as seen in the GC API page linked above) to scale the printout of what you are printing.

Hit me up on the Glimmer Gitter chat if you have any further questions.