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, Y
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, Y
If You Liked Shoes, You'll Love Glimmer!
(Fukuoka Ruby Award Competition 2022 Special Award Winner)
(RubyConf 2024 Workshop - How To Build Basic Desktop Applications in Ruby)
(RubyConf 2023 Workshop - How To Build Desktop Applications in Ruby)
(RubyConf 2022 Talk - Building Native GUI Apps in Ruby)
(Ruby Rogues Podcast Interview - Desktop Apps in Ruby ft. Andy)
Glimmer DSL for LibUI is a Fukuoka Award Winning prerequisite-free MRI Ruby desktop development cross-platform native GUI (Graphical User Interface) library. No need to pre-install any prerequisites. Just install the gem and have cross-platform native GUI that just works on Mac, Windows, and Linux!
| Mac | Windows | Linux |
|---|---|---|
LibUI is a relatively new C GUI library that renders native controls on every platform (similar to SWT, but without the heavy weight of the Java Virtual Machine). Applications built with Glimmer DSL for LibUI will provide the familiar native look, feel, and behavior of GUI on Mac, Windows, and Linux.
The main trade-off in using Glimmer DSL for LibUI as opposed to Glimmer DSL for SWT or Glimmer DSL for Tk is the fact that SWT and Tk are more mature than mid-alpha libui as GUI toolkits. Still, if there is only a need to build a small simple application, Glimmer DSL for LibUI could be a good convenient choice due to having zero prerequisites (beyond Ruby and the dependencies included in the Ruby gem). Also, just like Glimmer DSL for Tk, its apps start instantly and have a small memory footprint. LibUI is a promising new GUI toolkit that might prove quite worthy in the future.
Note that the new Glimmer DSL for WX is supporting the new wxruby3 binding for wxWidgets, which offers native GUI support just like LibUI, but with a mature toolkit. If you need to build more serious native GUI apps and prefer CRuby over JRuby, then Glimmer DSL for WX could be the best option for that.
Glimmer DSL for LibUI aims to provide a DSL similar to the Glimmer DSL for SWT to enable more productive desktop development in Ruby with:
Hello, World!
require 'glimmer-dsl-libui'
include Glimmer
window('hello world').show| Mac | Windows | Linux |
|---|---|---|
Basic Button
require 'glimmer-dsl-libui'
include Glimmer
window('hello world', 300, 200) {
button('Button') {
on_clicked do
msg_box('Information', 'You clicked the button')
end
}
}.showBasic Table Progress Bar
| Mac | Windows | Linux |
|---|---|---|
…| Mac | Windows | Linux |
|---|---|---|
Form Table
…| Mac | Windows | Linux |
|---|---|---|
Area Gallery
…| Mac | Windows | Linux |
|---|---|---|
Check out many more examples over here! Check out many real apps built with Glimmer DSL for LibUI over here!
NOTE: Glimmer DSL for LibUI is regularly catching up with changes in the C libui-ng library API and in beta mode. The C libui-ng is still mid-alpha, which is why Glimmer DSL for LibUI cannot be declared v1.0.0 yet. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. The more feedback and issues you report the better.
Learn more about the differences between various Glimmer DSLs by looking at the Glimmer DSL Comparison Table.
Note: the newest Ruby 3.3 is not fully supported yet.
Install glimmer-dsl-libui gem directly into a maintained Ruby version:
gem install glimmer-dsl-libuiOr install via Bundler Gemfile:
gem 'glimmer-dsl-libui', '~> 0.13.1'Test that installation worked by running the Glimmer Meta-Example:
glimmer examplesOr alternatively, run using the explicit Ruby command:
ruby -r glimmer-dsl-libui -e "require 'examples/meta_example'"| Mac | Windows | Linux |
|---|---|---|
Start by requiring the glimmer-dsl-libui Ruby gem, whether through a Ruby require 'glimmer-dsl-libui statement or Bundler.
Afterwards, to access the Glimmer GUI DSL:
Glimmer module into the top-level scope or a Ruby class.Glimmer::LibUI::Application into the main view Ruby classGlimmer::LibUI::CustomControl into a Ruby classGlimmer::LibUI::CustomWindow into a Ruby classGlimmer::LibUI::CustomShape into a Ruby class.You may learn more about the different options above with basic examples in the following subsections: Experimentation Usage, Prototyping Usage, Serious Usage.
If you are new to Glimmer DSL for LibUI (beginner), after going through the subsections below, check out the RubyConf 2022 talk "Building Native GUI Apps in Ruby", Glimmer GUI DSL Concepts, Glimmer Style Guide, Glimmer Command (just the basics, how to run an app, and how to run examples to start), [Girb](#girb
No open issues yet, or sync has not completed.