# Glimmer DSL for GTK Tetris + Cairo Tutorial Inspired by Mohit Sindhwani

**URL:** <https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793>\
**Category:** ruby-talk\
**Created:** [30 January 2022 22:27 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793 "2022-01-30T22:27:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyObtiva](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/andyobtiva/32/2375_2.png) [@AndyObtiva](https://rubytalk.org/u/AndyObtiva)\
**Post date:** [30 January 2022 22:27 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/1 "2022-01-30T22:27:09Z")

</div>

Glimmer DSL for GTK Tetris + Cairo Tutorial Inspired by Mohit Sindhwani's  
Blog Post:

> **[Glimmer DSL for GTK Tetris + Cairo Tutorial](https://andymaleh.blogspot.com/2022/01/glimmer-dsl-for-gtk-tetris-cairo.html)**
>
> code master glimmer swt ruby jruby java ood oop desktop web gui

Glimmer DSL for GTK is now a thing! Yes, you can finally write GTK  
applications directly with Glimmer's awesome declarative DSL syntax:

> **[GitHub - AndyObtiva/glimmer-dsl-gtk: Glimmer DSL for GTK - Ruby-GNOME Desktop...](https://github.com/AndyObtiva/glimmer-dsl-gtk)**
>
> Glimmer DSL for GTK - Ruby-GNOME Desktop Development GUI Library - GitHub - AndyObtiva/glimmer-dsl-gtk: Glimmer DSL for GTK - Ruby-GNOME Desktop Development GUI Library

Furthermore, declarative Cairo drawing support has just been added,  
including GUI reimplementations of the RCairo samples mentioned in Mohit  
Sindhwani's blog post "Cairo with Ruby - Samples using RCairo" (  
[Cairo with Ruby - Samples using RCairo](https://notepad.onghu.com/2021/cairo-samples-in-ruby/))

Last but not least, someone requested a Tetris sample written with Glimmer  
DSL for GTK ([Tetris variant in glimmer-dsl-gtk? · Issue #2 · AndyObtiva/glimmer-dsl-gtk · GitHub](https://github.com/AndyObtiva/glimmer-dsl-gtk/issues/2)). It  
also got delivered:

 ![](https://canada1.discourse-cdn.com/flex029/uploads/rubytalk/original/2X/8/851244a6efb57947665c9bf574909f15426efeac.png)

Mohit, thank you for writing such a great introductory RCairo tutorial. My  
tutorial takes it further by showing software engineers how to build those  
same Cairo graphics into a desktop GUI application (as opposed to just  
plain images).

Mohit, I look forward to hearing your thoughts about my Cairo tutorial for  
Glimmer DSL for GTK, and if you are so kind, maybe even blog about it and  
about Glimmer in general (like  
[GitHub - AndyObtiva/glimmer-dsl-libui: Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works)](https://github.com/AndyObtiva/glimmer-dsl-libui) and  
[GitHub - AndyObtiva/glimmer-dsl-swt: Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)](https://github.com/AndyObtiva/glimmer-dsl-swt))

Cheers!

> **···**
>
> --  
> Andy Maleh
> 
> LinkedIn: [https://www.linkedin.com/in/andymaleh](https://www.linkedin.com/in/andymaleh)  
> \<[https://www.linkedin.com/in/andymaleh](https://www.linkedin.com/in/andymaleh)\>  
> Blog: [http://andymaleh.blogspot.com](http://andymaleh.blogspot.com)  
> GitHub: [http://www.github.com/AndyObtiva](http://www.github.com/AndyObtiva)

---

<div class="post-metadata">

**Author:** ![Saji\_Hameed](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/saji_hameed/32/2120_2.png) [@Saji\_Hameed](https://rubytalk.org/u/Saji_Hameed)\
**Post date:** [31 January 2022 06:03 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/2 "2022-01-31T06:03:02Z")

</div>

Andy,

Do we need to install jruby to work with glimmer or would the regular ruby  
be enough?

saji

> **···**
>
> On Mon, Jan 31, 2022 at 7:28 AM Andy Maleh \<andy.am@gmail.com\> wrote:
> 
> > Glimmer DSL for GTK Tetris + Cairo Tutorial Inspired by Mohit Sindhwani's  
> > Blog Post:
> > 
> > [Code Master Blog: Glimmer DSL for GTK Tetris + Cairo Tutorial](https://andymaleh.blogspot.com/2022/01/glimmer-dsl-for-gtk-tetris-cairo.html)
> > 
> > Glimmer DSL for GTK is now a thing! Yes, you can finally write GTK  
> > applications directly with Glimmer's awesome declarative DSL syntax:  
> > [GitHub - AndyObtiva/glimmer-dsl-gtk: Glimmer DSL for GTK - Ruby-GNOME Desktop Development GUI Library](https://github.com/AndyObtiva/glimmer-dsl-gtk)
> > 
> > Furthermore, declarative Cairo drawing support has just been added,  
> > including GUI reimplementations of the RCairo samples mentioned in Mohit  
> > Sindhwani's blog post "Cairo with Ruby - Samples using RCairo" (  
> > [Cairo with Ruby - Samples using RCairo](https://notepad.onghu.com/2021/cairo-samples-in-ruby/))
> > 
> > Last but not least, someone requested a Tetris sample written with Glimmer  
> > DSL for GTK ([https://github.com/AndyObtiva/glimmer-dsl-gtk/issues/2](https://github.com/AndyObtiva/glimmer-dsl-gtk/issues/2)). It  
> > also got delivered:
> > 
> > [https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-gtk/master/screenshots/glimmer-dsl-gtk-linux-tetris.png](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-gtk/master/screenshots/glimmer-dsl-gtk-linux-tetris.png)
> > 
> > Mohit, thank you for writing such a great introductory RCairo tutorial. My  
> > tutorial takes it further by showing software engineers how to build those  
> > same Cairo graphics into a desktop GUI application (as opposed to just  
> > plain images).
> > 
> > Mohit, I look forward to hearing your thoughts about my Cairo tutorial for  
> > Glimmer DSL for GTK, and if you are so kind, maybe even blog about it and  
> > about Glimmer in general (like  
> > [GitHub - AndyObtiva/glimmer-dsl-libui: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.](https://github.com/AndyObtiva/glimmer-dsl-libui) and  
> > [GitHub - AndyObtiva/glimmer-dsl-swt: Glimmer DSL for SWT (JRuby Desktop Development Cross-Platform Native GUI Framework) - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer!](https://github.com/AndyObtiva/glimmer-dsl-swt))
> > 
> > Cheers!
> > 
> > --  
> > Andy Maleh
> > 
> > LinkedIn: [Andy Maleh | LinkedIn](https://www.linkedin.com/in/andymaleh)  
> > \<[https://www.linkedin.com/in/andymaleh&gt](https://www.linkedin.com/in/andymaleh&gt);  
> > Blog: [http://andymaleh.blogspot.com](http://andymaleh.blogspot.com)  
> > GitHub: [AndyObtiva (Andy Maleh) · GitHub](http://www.github.com/AndyObtiva)
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> 
> --

---

<div class="post-metadata">

**Author:** ![hmdne](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hmdne](https://rubytalk.org/u/hmdne)\
**Post date:** [31 January 2022 10:38 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/3 "2022-01-31T10:38:00Z")

</div>

For the GTK version, MRI is more than enough. Only SWT version needs JRuby.

> **···**
>
> On 1/31/22 07:03, Saji Hameed wrote:
> 
> > Andy,
> > 
> > Do we need to install jruby to work with glimmer or would the regular ruby be enough?
> > 
> > saji

---

<div class="post-metadata">

**Author:** ![Saji\_Hameed](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/saji_hameed/32/2120_2.png) [@Saji\_Hameed](https://rubytalk.org/u/Saji_Hameed)\
**Post date:** [31 January 2022 12:05 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/4 "2022-01-31T12:05:51Z")

</div>

Great! Thanks..

saji

> **···**
>
> On Mon, Jan 31, 2022 at 7:39 PM hmdne \<hmdne@airmail.cc\> wrote:
> 
> > For the GTK version, MRI is more than enough. Only SWT version needs JRuby.
> > 
> > On 1/31/22 07:03, Saji Hameed wrote:  
> > \> Andy,  
> > \>  
> > \> Do we need to install jruby to work with glimmer or would the regular  
> > \> ruby be enough?  
> > \>  
> > \> saji  
> > \>
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> 
> --

---

<div class="post-metadata">

**Author:** ![Mohit\_Sindhwani1](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Mohit\_Sindhwani1](https://rubytalk.org/u/Mohit_Sindhwani1)\
**Post date:** [1 February 2022 16:29 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/5 "2022-02-01T16:29:34Z")

</div>

Hi Andy,

Thanks!

> Glimmer DSL for GTK Tetris + Cairo Tutorial Inspired by Mohit Sindhwani's Blog Post:  
> [Code Master Blog: Glimmer DSL for GTK Tetris + Cairo Tutorial](https://andymaleh.blogspot.com/2022/01/glimmer-dsl-for-gtk-tetris-cairo.html)
> 
> Glimmer DSL for GTK is now a thing! Yes, you can finally write GTK applications directly with Glimmer's awesome declarative DSL syntax: [GitHub - AndyObtiva/glimmer-dsl-gtk: Glimmer DSL for GTK - Ruby-GNOME Desktop Development GUI Library](https://github.com/AndyObtiva/glimmer-dsl-gtk)
> 
> Furthermore, declarative Cairo drawing support has just been added, including GUI reimplementations of the RCairo samples mentioned in Mohit Sindhwani's blog post "Cairo with Ruby - Samples using RCairo" ([Cairo with Ruby - Samples using RCairo](https://notepad.onghu.com/2021/cairo-samples-in-ruby/))

This is very interesting. I need to try it myself to see how it feels to use it, but a quick glance reminds me of Canvas in HTML5.

> Mohit, thank you for writing such a great introductory RCairo tutorial. My tutorial takes it further by showing software engineers how to build those same Cairo graphics into a desktop GUI application (as opposed to just plain images).

For full disclosure, I didn't write the tutorial - I ported the samples code gets moved into Ruby code (and an additional post on what I learned - [Cairo with Ruby - Converting code from Cairo to RCairo](https://notepad.onghu.com/2021/cairo-rcairo-porting/) in doing that)

> Mohit, I look forward to hearing your thoughts about my Cairo tutorial for Glimmer DSL for GTK, and if you are so kind, maybe even blog about it and about Glimmer in general (like [GitHub - AndyObtiva/glimmer-dsl-libui: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.](https://github.com/AndyObtiva/glimmer-dsl-libui) and [GitHub - AndyObtiva/glimmer-dsl-swt: Glimmer DSL for SWT (JRuby Desktop Development Cross-Platform Native GUI Framework) - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer!](https://github.com/AndyObtiva/glimmer-dsl-swt))

I do want to use Glimmer because I want to create GUIs from JRuby for some of the stuff I'm working on. I'm guessing that the Cairo DSL works with MRI only and not Jruby (native extension).

When I do get around to using Glimmer, I will definitely write about it... it's part of my plan to write about JRuby, esp bits that are unique to JRuby vs CRuby.  
- Creating/ Packaging a JAR: you commented on this also [done]  
- Accessing Java code from Ruby code running JRuby [done]  
- Creating distributable Ruby environments & binaries with JRuby [in progress]  
- GUIs with JRuby (using Glimmer) [in the future]

Best Regards,  
Mohit.  
2022-2-2 | 12:28 am.

> **···**
>
> On 2022-1-31 6:27 am, Andy Maleh wrote:  
> from: [Cairo samples](https://www.cairographics.org/samples/) with notes on how the C

---

<div class="post-metadata">

**Author:** ![AndyObtiva](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/andyobtiva/32/2375_2.png) [@AndyObtiva](https://rubytalk.org/u/AndyObtiva)\
**Post date:** [1 February 2022 18:04 UTC](https://rubytalk.org/t/glimmer-dsl-for-gtk-tetris-cairo-tutorial-inspired-by-mohit-sindhwani/75793/6 "2022-02-01T18:04:28Z")

</div>

Mohit, thank you for the response.

> I do want to use Glimmer because I want to create GUIs from JRuby for some of the stuff I'm working on.  
> I'm guessing that the Cairo DSL works with MRI only and not Jruby (native extension).

Glimmer DSL for SWT, which runs in JRuby, does have an equivalent of  
Cairo called the Canvas Shape DSL  
([https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER\_GUI\_DSL\_SYNTAX.md#canvas-shape-dsl](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#canvas-shape-dsl)).  
SWT uses GTK on Linux, so the Canvas Shape DSL leverages Cairo on  
Linux behind the scenes.

> Creating/ Packaging a JAR: you commented on this also [done]

Yes, I commented to mention that Glimmer DSL for SWT provides  
application native executable packaging in JRuby into Mac APP/DMG/PKG,  
Windows MSI/EXE, and Linux DEB/RPM files:

> <https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md>

Cheers and I look forward to reading your future blog posts!

> **···**
>
> On Tue, Feb 1, 2022 at 11:29 AM Mohit Sindhwani \<mo\_mail@onghu.com\> wrote:
> 
> > Hi Andy,
> > 
> > Thanks!
> > 
> > On 2022-1-31 6:27 am, Andy Maleh wrote:  
> > \> Glimmer DSL for GTK Tetris + Cairo Tutorial Inspired by Mohit  
> > \> Sindhwani's Blog Post:  
> > \> [Code Master Blog: Glimmer DSL for GTK Tetris + Cairo Tutorial](https://andymaleh.blogspot.com/2022/01/glimmer-dsl-for-gtk-tetris-cairo.html)  
> > \>  
> > \> Glimmer DSL for GTK is now a thing! Yes, you can finally write GTK  
> > \> applications directly with Glimmer's awesome declarative DSL syntax:  
> > \> [GitHub - AndyObtiva/glimmer-dsl-gtk: Glimmer DSL for GTK - Ruby-GNOME Desktop Development GUI Library](https://github.com/AndyObtiva/glimmer-dsl-gtk)  
> > \>  
> > \> Furthermore, declarative Cairo drawing support has just been added,  
> > \> including GUI reimplementations of the RCairo samples mentioned in  
> > \> Mohit Sindhwani's blog post "Cairo with Ruby - Samples using RCairo"  
> > \> ([Cairo with Ruby - Samples using RCairo](https://notepad.onghu.com/2021/cairo-samples-in-ruby/))
> > 
> > This is very interesting. I need to try it myself to see how it feels to  
> > use it, but a quick glance reminds me of Canvas in HTML5.
> > 
> > \> Mohit, thank you for writing such a great introductory RCairo  
> > \> tutorial. My tutorial takes it further by showing software engineers  
> > \> how to build those same Cairo graphics into a desktop GUI application  
> > \> (as opposed to just plain images).
> > 
> > For full disclosure, I didn't write the tutorial - I ported the samples  
> > from: [https://www.cairographics.org/samples/](https://www.cairographics.org/samples/) with notes on how the C  
> > code gets moved into Ruby code (and an additional post on what I learned  
> > - [Cairo with Ruby - Converting code from Cairo to RCairo](https://notepad.onghu.com/2021/cairo-rcairo-porting/) in doing that)
> > 
> > \> Mohit, I look forward to hearing your thoughts about my Cairo tutorial  
> > \> for Glimmer DSL for GTK, and if you are so kind, maybe even blog about  
> > \> it and about Glimmer in general (like  
> > \> [GitHub - AndyObtiva/glimmer-dsl-libui: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer! - No need to pre-install any prerequisites. Just install the gem and have platform-independent GUI that just works on Mac, Windows, and Linux.](https://github.com/AndyObtiva/glimmer-dsl-libui) and  
> > \> [GitHub - AndyObtiva/glimmer-dsl-swt: Glimmer DSL for SWT (JRuby Desktop Development Cross-Platform Native GUI Framework) - The Quickest Way From Zero To GUI - If You Liked Shoes, You'll Love Glimmer!](https://github.com/AndyObtiva/glimmer-dsl-swt))  
> > I do want to use Glimmer because I want to create GUIs from JRuby for  
> > some of the stuff I'm working on. I'm guessing that the Cairo DSL works  
> > with MRI only and not Jruby (native extension).
> > 
> > When I do get around to using Glimmer, I will definitely write about  
> > it... it's part of my plan to write about JRuby, esp bits that are  
> > unique to JRuby vs CRuby.  
> > - Creating/ Packaging a JAR: you commented on this also [done]  
> > - Accessing Java code from Ruby code running JRuby [done]  
> > - Creating distributable Ruby environments & binaries with JRuby [in  
> > progress]  
> > - GUIs with JRuby (using Glimmer) [in the future]
> > 
> > Best Regards,  
> > Mohit.  
> > 2022-2-2 | 12:28 am.
> 
> --  
> Andy Maleh
> 
> LinkedIn: [Andy Maleh | LinkedIn](https://www.linkedin.com/in/andymaleh)  
> Blog: [http://andymaleh.blogspot.com](http://andymaleh.blogspot.com)  
> GitHub: [AndyObtiva (Andy Maleh) · GitHub](http://www.github.com/AndyObtiva)
