GithubHelp home page GithubHelp logo

andyobtiva / glimmer Goto Github PK

View Code? Open in Web Editor NEW
513.0 11.0 17.0 23.04 MB

DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS

License: MIT License

Ruby 100.00%
desktop desktop-application-sdk ruby jruby glimmer gui-framework gui-toolkit gui swt macos

glimmer's Introduction

Glimmer 2.7.7

DSL Framework for Ruby GUI and More

Gem Version rspec Coverage Status Maintainability Join the chat at https://gitter.im/AndyObtiva/glimmer

If You Liked Shoes, You'll Love Glimmer!

(Original Glimmer Library Handling World’s Ruby GUI Needs Since 2007. Beware of Imitators!)

(Glimmer DSL for LibUI Won a Fukuoka Ruby 2022 Special Award [Announcement])

(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 VIDEO TUTORIAL CHANNEL

glimmer demo

Glimmer started out as a GUI Library and grew into a full-fledged DSL Framework with support for multiple GUI DSLs. Glimmer's namesake is referring to the Glimmer of Ruby in Graphical User Interfaces (contrary to popular myth perpetrated by Charles Nutter, Glimmer has nothing to do with the ill-fated Whitney Houston movie, which does not in fact share the same name)


Featured in JRuby Cookbook
and Chalmers/Gothenburg University Software Engineering Master's Lecture Material

Glimmer is a DSL (Domain-Specific Language) Framework that consists of two things:

Glimmer is the cream of the crop when it comes to building DSLs in Ruby:

  • Supports building the tersest most concise domain specific language syntax in Ruby.
  • Maximum readability and maintainability.
  • No extra unnecessary block variables when not needed.
  • DSL Blocks are true Ruby closures that can conveniently leverage variables from the outside and utilize standard Ruby code in and around. Just code in Ruby as usual without any hinderances! No surprising restrictions or strange uses of instance_exec/eval.
  • DSL syntax is limited to classes that mixin the Glimmer module, so the rest of the code is fully safe from namespace pollution.
  • Multiple DSLs may be mixed together safely to achieve maximum expressability, composability, and productivity.
  • DSLs are fully configurable, so you may activate and deactivate DSLs as per your current needs only.

Start by checking out:

Glimmer DSL Comparison Table:

DSL Platforms Native? Vector Graphics? Pros Cons Prereqs
Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) Mac / Windows / Linux Yes Yes (Canvas Shape DSL) Very Mature / Scaffolding / Native Executable Packaging / Custom Widgets Slow JRuby Startup Time / Heavy Memory Footprint Java / JRuby
Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library) Mac / Windows / Linux Yes Yes (Area API) Very Simple Setup / Fast Startup Time / Light Memory Footprint LibUI is an Incomplete Mid-Alpha Only None Other Than MRI Ruby
Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library) Mac / Windows / Linux Some Native-Themed Widgets (Not Truly Native) Yes (Canvas) Fast Startup Time / Light Memory Footprint Complicated setup / Widgets Do Not Look Truly Native, Espcially on Linux ActiveTcl / MRI Ruby
Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library) Mac / Windows / Linux Only on Linux Yes (Cairo) Complete Access to GNOME Features on Linux (Forte) Not Native on Mac and Windows None Other Than MRI Ruby on Linux / Brew Packages on Mac / MSYS & MING Toolchains on Windows / MRI Ruby
Glimmer DSL for FX (FOX Toolkit Ruby Desktop Development GUI Library) Mac (requires XQuartz) / Windows / Linux No Yes (Canvas) No Prerequisites on Windows (Forte Since Binaries Are Included Out of The Box) Widgets Do Not Look Native / Mac Usage Obtrusively Starts XQuartz None Other Than MRI Ruby on Windows / XQuarts on Mac / MRI Ruby
Glimmer DSL for WX (wxWidgets Ruby Desktop Development GUI Library) Mac / Windows / Linux Yes Yes Fast Startup Time / Light Memory Footprint wxruby3 is still beta and does not support Mac yet wxWidgets, Doxygen, SWIG, GNU g++ 4.8 on Linux or RubyInstaller+DevKit on Windows
Glimmer DSL for JFX (JRuby JavaFX Desktop Development GUI Library) Mac / Windows / Linux No Yes (javafx.scene.shape and javafx.scene.canvas) Rich in Custom Widgets Slow JRuby Startup Time / Heavy Memory Footprint / Widgets Do Not Look Native Java / JRuby / JavaFX SDK
Glimmer DSL for Swing (JRuby Swing Desktop Development GUI Library) Mac / Windows / Linux No Yes (Java2D) Very Mature Slow JRuby Startup Time / Heavy Memory Footprint / Widgets Do Not Look Native Java / JRuby
Glimmer DSL for Web (Ruby in the Browser Web GUI Frontend Library) All Web Browsers No Yes (SVG) Simpler than All JavaScript Technologies / Leverages Existing HTML/JS/CSS Skills Setup Process / Early Alpha Rails
Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps / Archived & Superseded by Glimmer DSL for Web) All Web Browsers No Yes (Canvas Shape DSL) Simpler than All JavaScript Technologies / Auto-Webify Desktop Apps Setup Process / Incomplete Alpha Rails
Glimmer DSL for XML (& HTML) All Web Browsers No Yes (SVG) Programmable / Lighter-weight Than Actual XML XML Elements Are Sometimes Not Well-Named (Many Types of Input) None
Glimmer DSL for CSS All Web Browsers No Yes Programmable CSS Is Over-Engineered / Too Many Features To Learn None

Table of Contents

DSL Engine

Glimmer is fundamentally a DSL Engine that can support any number of DSLs like the official Glimmer DSLs (gems starting with the glimmer-dsl- prefix like glimmer-dsl-swt) or any DSLs for that matter.

Glimmer DSL syntax consists mainly of:

  • keywords (e.g. table for a table widget)
  • style/args (e.g. :multi as in table(:multi) for a multi-line selection table widget)
  • content (nested properties/keywords/listeners) (e.g. { table_column { text 'Name'} } as in table(:multi) { table_column { text 'Name'} } for a multi-line selection table widget with a table column having header text property 'Name' as content)
  • methods (e.g. shell.show opens a window)

Here is a Hello, World! example from Glimmer DSL for SWT:

include Glimmer

shell(:no_resize) { # keyword + style arg
  text "Glimmer" # attribute content
  
  label { # keyword content
    text "Hello, World!" # attribute content
  }
}.open

That code renders the following GUI (Graphical User Interface):

Hello World

The Glimmer DSL Engine's architecture is based on the following Design Patterns and Data Structures:

  • Interpreter Design Pattern: to define interpretable expressions of DSL keywords
  • Chain of Responsibility Design Pattern / Queue Data Structure: to chain expression handlers in order of importance for processing DSL keywords
  • Adapter Design Pattern: to adapt expressions into handlers in a chain of responsibility
  • Stack Data Structure: to handle processing parent/child nesting of DSL keyword expressions in the correct order
  • Proxy Design Pattern: to shield consumers of GUI libraries built with Glimmer from low-level GUI widget details

Glimmer's use of the Interpreter Design Pattern in processing DSLs is also known as the Virtual Machine Architectural Style. After all, DSL expressions are virtual machine opcodes that process nested keywords stored in a stack. I built Glimmer's original DSL back in 2007 without knowing the Virtual Machine Architectural Style (except perhaps as an esoteric technology powering Java), but stumbled upon it anyways through following the Gang of Four Design Patterns mentioned above, chiefly the Interpreter Design Pattern and the Chain of Responsibility Design Pattern.

Every keyword in a Glimmer DSL is represented by a DSL expression that is processed by an Expression subclass selected from a chain of expressions (interpreters) pre-configured in a DSL chain of responsibility via Glimmer::DSL::Engine.add_dynamic_expressions(DSLNameModule, expression_names_array).

Expressions are either:

  • Static (subclass of StaticExpression, which is a subclass of Expression): if they represent a single pre-identified keyword (e.g. color or display)
  • Dynamic (subclass of Expression): if they represent keywords calculated on the fly during processing (e.g. an SWT widget like label or a random XML element called folder representing <folder></folder>)

Optionally, expressions can be parent expressions that contain other expressions, and must include the ParentExpression mixin module as such.

Additionally, every expression that serves as a top-level entry point into the DSL must mixin TopLevelExpression

Static expressions are optimized in performance since they pre-define methods on the Glimmer module matching the static keywords they represent (e.g. color causes creating a Glimmer#color method for processing color expressions) and completely bypass as a result the Glimmer DSL Engine Chain of Responsibility. That said, they must be avoided if the same keyword might occur multiple times, but with different requirements for arguments, block, and parenthood type.

Every Expression sublcass must specify two methods at least:

  • can_interpret?(parent, keyword, *args, &block): to quickly test if the keyword and arg/block/parent combination qualifies for interpretation by the current Expression or to otherwise delegate to the next expression in the chain of responsibility.
  • interpret(parent, keyword, *args, &block): to go ahead and interpret a DSL expression that qualified for interpretation

StaticExpression sublcasses may skip the can_interpret? method since they include a default implementation for it that matches the name of the keyword from the class name by convention. For example, a color keyword would have a ColorExpression class, so color is inferred automatically from class name and used in deciding whether the class can handle a color keyword or not. StaticExpression may declare the following class method options (if any other than downcased (default) is set, then downcased must be set explicitly if needed):

  • downcased true (default): indicates that the StaticExpression expects downcased keywords (e.g. COLOR {})
  • upcased true: indicates that the StaticExpression expects upcased keywords (e.g. COLOR {}). Note that upcased static expressions always expect either argument parentheses or block curly braces to be invoked as a static expression method instead of a constant.
  • capitalized true: indicates that the StaticExpression expects capitalized keywords (e.g. Color {}). Note that capitalized static expressions always expect either argument parentheses or block curly braces to be invoked as a static expression method instead of a constant.
  • case_insensitive true: indicates that the StaticExpression supports downcased, upcased, and capitalized keywords (e.g. color {}, COLOR {}, and Color {}). Note that upcased/capitalized static expressions always expect either argument parentheses or block curly braces to be invoked as a static expression method instead of a constant.

ParentExpression subclasses can optionally override this extra method, which is included by default and simply invokes the parent's passed block to process its children:

  • add_content(parent, keyword, *args, &block)

For example, some parent widgets use their block for other reasons or process their children at very specific times, so they may override that method and disable it, or otherwise call super and do additional work.

Otherwise, all expressions support the around hook method:

  • around(parent, keyword, args, block, &interpret_and_add_content): a hook for executing code around both interpret and add_content. Clients may invoke interpret_and_add_content.call or yield when ready for interpretation. parent, keyword, args, and block are supplied in case they are needed in the around logic.

Example of a dynamic expression:

module Glimmer
  module DSL
    module SWT
      class WidgetExpression < Expression
        include ParentExpression

        EXCLUDED_KEYWORDS = %w[shell display tab_item]

        def can_interpret?(parent, keyword, *args, &block)
          !EXCLUDED_KEYWORDS.include?(keyword) and
            parent.respond_to?(:swt_widget) and
            Glimmer::SWT::WidgetProxy.widget_exists?(keyword)
        end

        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::WidgetProxy.create(keyword, parent, args)
        end

        def add_content(parent, keyword, *args, &block)
          super
          parent.post_add_content
        end

      end
    end
  end
end

Example of a static expression (does not need can_interpret?):

module Glimmer
  module DSL
    module Opal
      class ColorExpression < StaticExpression
        include TopLevelExpression
  
        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::ColorProxy.new(*args)
        end
      end
    end
  end
end

Extra convenience expression mixins/superclasses for use via inclusion/subclassing in Glimmer GUI libraries:

  • Glimmer::DSL::BindExpression: enables usage of bind data-binding keyword to build a Glimmer::DataBinding::ModelBinding object for data-binding purposes.
  • Glimmer::DSL::ShineDataBindingExpression: enables Shine data-binding syntax via Glimmer::DataBinding::Shine, a facade for the bind keyword, hiding it with the <=> operator for bidirectional (two-way) data-binding and the <= operator for unidirectional (one-way) data-binding.
  • Glimmer::DSL::ObserveExpression: enables a one-way observe operation. You may learn more about them by looking at how Glimmer DSL for SWT uses them.

DSL expressions go into the glimmer/dsl/{dsl_name} namespace directory.

Also, every DSL requires a glimmer/dsl/{dsl_name}/dsl.rb file, which configures the DSL into Glimmer via a call to:

Glimmer::DSL::Engine.add_dynamic_expressions(DSLNameModule, expression_names_array)

Expression names are underscored verions of Expression subclass names minus the _expression suffix.

For example, here is an SWT DSL configuration:

require 'glimmer/launcher'
require Glimmer::Launcher.swt_jar_file
require 'glimmer/dsl/engine'
Dir[File.expand_path('../*_expression.rb', __FILE__)].each {|f| require f}

module Glimmer
  module DSL
    module SWT
      Engine.add_dynamic_expressions(
        SWT,
        %w[
          layout
          widget_listener
          combo_selection_data_binding
          checkbox_group_selection_data_binding
          radio_group_selection_data_binding
          list_selection_data_binding
          tree_items_data_binding
          table_items_data_binding
          data_binding
          cursor
          font
          image
          property
          block_property
          widget
          custom_widget
        ]
      )
    end
  end
end

Setup

Follow these steps to author a Glimmer DSL:

  • Add gem 'glimmer', '~> 2.7.7' to Gemfile and run bundle or run gem install glimmer -v2.7.7 and add require 'glimmer'
  • Create glimmer/dsl/[dsl_name]/dsl.rb, which requires and adds all dynamic expressions for the [dsl_name] Glimmer DSL module as per the code shown in the previous section (or Official DSLs as examples)
  • Create glimmer/dsl/[dsl_name]/[expresion_name]_expresion.rb for every [expresion_name] expression needed, whether dynamic or static

Configuration

Glimmer configuration may be done via the Glimmer::Config module.

logger

The Glimmer DSL engine supports logging via a standard STDOUT Ruby Logger configured in the Glimmer::Config.logger config option. It is set to level Logger::ERROR by default. Log level may be adjusted via Glimmer::Config.logger.level just like any other Ruby Logger.

Example:

Glimmer::Config.logger.level = :debug

This results in more verbose debug loggging to STDOUT, which is very helpful in troubleshooting Glimmer DSL syntax when needed.

Example log:

D, [2017-07-21T19:23:12.587870 #35707] DEBUG -- : method: shell and args: []
D, [2017-07-21T19:23:12.594405 #35707] DEBUG -- : ShellCommandHandler will handle command: shell with arguments []
D, [2017-07-21T19:23:12.844775 #35707] DEBUG -- : method: composite and args: []
D, [2017-07-21T19:23:12.845388 #35707] DEBUG -- : parent is a widget: true
D, [2017-07-21T19:23:12.845833 #35707] DEBUG -- : on listener?: false
D, [2017-07-21T19:23:12.864395 #35707] DEBUG -- : WidgetCommandHandler will handle command: composite with arguments []
D, [2017-07-21T19:23:12.864893 #35707] DEBUG -- : widget styles are: []
D, [2017-07-21T19:23:12.874296 #35707] DEBUG -- : method: list and args: [:multi]
D, [2017-07-21T19:23:12.874969 #35707] DEBUG -- : parent is a widget: true
D, [2017-07-21T19:23:12.875452 #35707] DEBUG -- : on listener?: false
D, [2017-07-21T19:23:12.878434 #35707] DEBUG -- : WidgetCommandHandler will handle command: list with arguments [:multi]
D, [2017-07-21T19:23:12.878798 #35707] DEBUG -- : widget styles are: [:multi]

The logger instance may be replaced with a custom logger via Glimmer::Config.logger = custom_logger

To reset logger to the default instance, you may call Glimmer::Config.reset_logger!

All logging is done lazily via blocks (e.g. logger.debug {message}) to avoid affecting app performance with logging when below the configured logging level threshold.

Glimmer DSL for SWT enhances Glimmer default logging support via the Ruby logging gem, enabling buffered asynchronous logging in a separate thread, thus completely unhindering normal desktop app performance.

loop_max_count

Glimmer has infinite loop detection support. It can detect when an infinite loop is about to occur in method_missing and stops it. It detects potential infinite loops when the same keyword and args repeat more than 100 times, which is unusual in a GUI app.

The max limit can be changed via the Glimmer::Config::loop_max_count=(count) config option.

Infinite loop detection may be disabled altogether if needed by setting Glimmer::Config::loop_max_count to -1

excluded_keyword_checkers

Glimmer permits consumers to exclude keywords from DSL processing by its engine via the excluded_keyword_checkers config option.

To do so, add a proc to it that returns a boolean indicating if a keyword is excluded or not.

Note that this proc runs within the context of the Glimmer object (as in the object mixing in the Glimmer module), so checker can can pretend to run there with its self object assumption.

Example of keywords excluded by glimmer-dsl-swt:

Glimmer::Config.excluded_keyword_checkers << lambda do |method_symbol, *args|
  method = method_symbol.to_s
  result = false
  result ||= method.start_with?('on_swt_') && is_a?(Glimmer::UI::CustomWidget) && respond_to?(method)
  result ||= method == 'dispose' && is_a?(Glimmer::UI::CustomWidget) && respond_to?(method)
  result ||= ['drag_source_proxy', 'drop_target_proxy'].include?(method) && is_a?(Glimmer::UI::CustomWidget)
  result ||= method == 'post_initialize_child'
  result ||= method.end_with?('=')
  result ||= ['finish_edit!', 'search', 'all_tree_items', 'depth_first_search'].include?(method) && is_a?(Glimmer::UI::CustomWidget) && body_root.respond_to?(method)
end

log_excluded_keywords

(default = false)

This just tells Glimmer whether to log excluded keywords or not (at the debug level). It is off by default.

Multi-DSL Support

The Glimmer DSL Engine allows mixing DSLs, which comes in handy when doing things like rendering a desktop GUI DSL browser widget additionally leveraging the HTML DSL and CSS DSL for its content.

DSLs are activated by top-level keywords (expressions denoted as TopLevelExpression). For example, the html keyword activates the Glimmer DSL for XML and the css keyword activates the Glimmer DSL for CSS. Glimmer automatically recognizes top-level keywords in each DSL and activates the DSL accordingly. Once done processing a nested DSL top-level keyword, Glimmer switches back to the prior DSL automatically.

By default, all loaded DSLs (required glimmer DSL gems) are enabled.

For example, this shows "Hello, World!" inside a Glimmer DSL for SWT desktop app browser widget using html and css from Glimmer DSL for XML and Glimmer DSL for CSS:

require 'glimmer-dsl-swt'
require 'glimmer-dsl-xml'
require 'glimmer-dsl-css'

include Glimmer

shell {
  minimum_size 130, 130
  @browser = browser {
    text html {
      head {
        meta(name: "viewport", content: "width=device-width, initial-scale=2.0")
        style {
          css {
            h1 {
              background 'yellow'
            }
          }
        }
      }
      body {
        h1 { "Hello, World!" }
      }
    }
  }
}.open

API methods to enable/disable DSLs:

Glimmer::DSL::Engine.disable_dsl(dsl): disables a particular DSL

Example: Glimmer::DSL::Engine.disable_dsl(:swt)

Glimmer::DSL::Engine.enable_dsl(dsl): enables a particular DSL

Example: Glimmer::DSL::Engine.disable_dsl(:swt)

Glimmer::DSL::Engine.enabled_dsls=(dsls): enables only the specified DSLs, disabling all other loaded DSLs

Example: Glimmer::DSL::Engine.enabled_dsls = [:xml, :css]

Official DSLs

Here, we showcase official Glimmer DSLs; that is gems starting with the glimmer-dsl- prefix.

(you can skip ahead if you prefer to learn more about the Glimmer DSL Engine or Data-Binding Library first)

Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)

Glimmer DSL for SWT is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster version of Ruby. Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust Eclipse SWT library. Glimmer DSL for SWT additionally innovates by having built-in data-binding support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. To get started quickly, Glimmer DSL for SWT offers scaffolding options for Apps, Gems, and Custom Widgets. Glimmer DSL for SWT also includes native-executable packaging support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on the Mac + App Store and MSI/EXE files on Windows.

To get started, visit the Glimmer DSL for SWT project page for instructions on installing the glimmer-dsl-swt gem.

Glimmer DSL for SWT Samples
Hello, World!

Hello World

Glimmer GUI code (from samples/hello/hello_world.rb):

include Glimmer

shell {
  text "Glimmer"
  label {
    text "Hello, World!"
  }
}.open
Glimmer Tetris

Tetris

Glimmer GUI code (from samples/elaborate/tetris.rb):

# ...
    shell(:no_resize) {
      grid_layout {
        num_columns 2
        make_columns_equal_width false
        margin_width 0
        margin_height 0
        horizontal_spacing 0
      }
      
      text 'Glimmer Tetris'
      minimum_size 475, 500
      background :gray
      
      tetris_menu_bar(game: game)
            
      playfield(game_playfield: game.playfield, playfield_width: playfield_width, playfield_height: playfield_height, block_size: BLOCK_SIZE)
      
      score_lane(game: game, block_size: BLOCK_SIZE) {
        layout_data(:fill, :fill, true, true)
      }
    }
# ...
Hello, Table!

Hello Table

Glimmer GUI code (from samples/hello/hello_table.rb):

# ...
    shell {
      grid_layout
      
      text 'Hello, Table!'
      
      label {
        layout_data :center, :center, true, false
        
        text 'Baseball Playoff Schedule'
        font height: 30, style: :bold
      }
      
      combo(:read_only) {
        layout_data :center, :center, true, false
        selection bind(BaseballGame, :playoff_type)
        font height: 16
      }
      
      table(:editable) { |table_proxy|
        layout_data :fill, :fill, true, true
      
        table_column {
          text 'Game Date'
          width 150
          sort_property :date # ensure sorting by real date value (not `game_date` string specified in items below)
          editor :date_drop_down, property: :date_time
        }
        table_column {
          text 'Game Time'
          width 150
          sort_property :time # ensure sorting by real time value (not `game_time` string specified in items below)
          editor :time, property: :date_time
        }
        table_column {
          text 'Ballpark'
          width 180
          editor :none
        }
        table_column {
          text 'Home Team'
          width 150
          editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
        }
        table_column {
          text 'Away Team'
          width 150
          editor :combo, :read_only # read_only is simply an SWT style passed to combo widget
        }
        table_column {
          text 'Promotion'
          width 150
          # default text editor is used here
        }
        
        # Data-bind table items (rows) to a model collection property, specifying column properties ordering per nested model
        items bind(BaseballGame, :schedule), column_properties(:game_date, :game_time, :ballpark, :home_team, :away_team, :promotion)
        
        # Data-bind table selection
        selection bind(BaseballGame, :selected_game)
        
        # Default initial sort property
        sort_property :date
        
        # Sort by these additional properties after handling sort by the column the user clicked
        additional_sort_properties :date, :time, :home_team, :away_team, :ballpark, :promotion
        
        menu {
          menu_item {
            text 'Book'
            
            on_widget_selected {
              book_selected_game
            }
          }
        }
      }
      
      button {
        text 'Book Selected Game'
        layout_data :center, :center, true, false
        font height: 16
        enabled bind(BaseballGame, :selected_game)
        
        on_widget_selected {
          book_selected_game
        }
      }
    }.open
# ...
Production Desktop Apps Built with Glimmer DSL for SWT

Are We There Yet LogoAre We There Yet? - Small Project Tracking App (leveraging ActiveRecord and SQLite)

Are We There Yet? App Screenshot

Math Bowling LogoMath Bowling - Elementary Level Math Game Featuring Bowling Rules

Math Bowling App Screenshot

Garderie Rainbow Daily Agenda LogoGarderie Rainbow Daily Agenda - A child nursery daily agenda reporting desktop app (communicates to a Rails Server and stores data using ActiveRecord/PostgreSQL [in its rails_server branch])

Garderie Rainbow Daily Agenda App Screenshot

Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)

Glimmer DSL for Opal is an experimental proof-of-concept web GUI adapter for Glimmer desktop apps (i.e. apps built with Glimmer DSL for SWT). It webifies them via Rails, allowing Ruby desktop apps to run on the web via Opal Ruby without changing a line of code. Apps may then be custom-styled for the web with standard CSS.

Glimmer DSL for Opal webifier successfully reuses the entire Glimmer core DSL engine in Opal Ruby inside a web browser, and as such inherits the full range of Glimmer desktop data-binding capabilities for the web.

To get started, visit the Glimmer DSL for Opal project page for instructions on installing the glimmer-dsl-opal gem.

Glimmer DSL for Opal Samples
Hello, Computed!

Add the following require statement to app/assets/javascripts/application.rb

require 'samples/hello/hello_computed'

Or add the Glimmer code directly if you prefer to play around with it:

class HelloComputed
  class Contact
    attr_accessor :first_name, :last_name, :year_of_birth
  
    def initialize(attribute_map)
      @first_name = attribute_map[:first_name]
      @last_name = attribute_map[:last_name]
      @year_of_birth = attribute_map[:year_of_birth]
    end
  
    def name
      "#{last_name}, #{first_name}"
    end
  
    def age
      Time.now.year - year_of_birth.to_i
    rescue
      0
    end
  end
end

class HelloComputed
  include Glimmer

  def initialize
    @contact = Contact.new(
      first_name: 'Barry',
      last_name: 'McKibbin',
      year_of_birth: 1985
    )
  end

  def launch
    shell {
      text 'Hello, Computed!'
      composite {
        grid_layout {
          num_columns 2
          make_columns_equal_width true
          horizontal_spacing 20
          vertical_spacing 10
        }
        label {text 'First &Name: '}
        text {
          text bind(@contact, :first_name)
          layout_data {
            horizontal_alignment :fill
            grab_excess_horizontal_space true
          }
        }
        label {text '&Last Name: '}
        text {
          text bind(@contact, :last_name)
          layout_data {
            horizontal_alignment :fill
            grab_excess_horizontal_space true
          }
        }
        label {text '&Year of Birth: '}
        text {
          text bind(@contact, :year_of_birth)
          layout_data {
            horizontal_alignment :fill
            grab_excess_horizontal_space true
          }
        }
        label {text 'Name: '}
        label {
          text bind(@contact, :name, computed_by: [:first_name, :last_name])
          layout_data {
            horizontal_alignment :fill
            grab_excess_horizontal_space true
          }
        }
        label {text 'Age: '}
        label {
          text bind(@contact, :age, on_write: :to_i, computed_by: [:year_of_birth])
          layout_data {
            horizontal_alignment :fill
            grab_excess_horizontal_space true
          }
        }
      }
    }.open
  end
end

HelloComputed.new.launch

Glimmer app on the desktop (using glimmer-dsl-swt gem):

Glimmer DSL for SWT Hello Computed

Glimmer app on the web (using glimmer-dsl-opal gem):

Start the Rails server:

rails s

Visit http://localhost:3000

You should see "Hello, Computed!"

Glimmer DSL for Opal Hello Computed

Glimmer Calculator

Add the glimmer-cs-calculator gem to Gemfile (without requiring):

gem 'glimmer-cs-calculator', require: false

Add the following require statement to app/assets/javascripts/application.rb

require 'glimmer-cs-calculator/launch'

Sample GUI code (relies on custom widgets command_button, operation_button, and number_button):

# ...
shell {
  minimum_size (OS.mac? ? 320 : (OS.windows? ? 390 : 520)), 240
  image File.join(APP_ROOT, 'package', 'windows', "Glimmer Calculator.ico") if OS.windows?
  text "Glimmer - Calculator"
  grid_layout 4, true
  # Setting styled_text to multi in order for alignment options to activate
  styled_text(:multi, :wrap, :border) {
    text bind(@presenter, :result)
    alignment swt(:right)
    right_margin 5
    font height: 40
    layout_data(:fill, :fill, true, true) {
      horizontal_span 4
    }
    editable false
    caret nil
  }
  command_button('AC')
  operation_button('÷')
  operation_button('×')
  operation_button('−')
  (7..9).each { |number|
    number_button(number)
  }
  operation_button('+', font: @button_font_big, vertical_span: 2)
  (4..6).each { |number|
    number_button(number)
  }
  (1..3).each { |number|
    number_button(number)
  }
  command_button('=', font: @button_font_big, vertical_span: 2)
  number_button(0, horizontal_span: 2)
  operation_button('.')
}
# ...

Glimmer app on the desktop (using the glimmer-dsl-swt gem):

Glimmer Calculator Linux

Glimmer app on the web (using glimmer-dsl-opal gem):

Start the Rails server:

rails s

Visit http://localhost:3000 (or visit: http://glimmer-cs-calculator-server.herokuapp.com)

You should see "Glimmer Calculator"

Glimmer Calculator Opal

Here is an Apple Calculator CSS themed version (with CSS only, no app code changes):

Visit http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple

You should see "Apple Calculator Theme"

Glimmer Calculator Opal Apple Calculator Theme

Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library)

Glimmer DSL for LibUI is a prerequisite-free Ruby desktop development GUI library. No need to pre-install any prerequisites. Just install the gem and have platform-independent native GUI that just works!

LibUI is a thin Ruby wrapper around libui, 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).

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 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.

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:

  • Declarative DSL syntax that visually maps to the GUI widget hierarchy
  • Convention over configuration via smart defaults and automation of low-level details
  • Requiring the least amount of syntax possible to build GUI
  • Bidirectional Data-Binding to declaratively wire and automatically synchronize GUI with Business Models
  • Custom Widget support
  • Scaffolding for new custom widgets, apps, and gems
  • Native-Executable packaging on Mac, Windows, and Linux
Glimmer DSL for LibUI Samples
Hello, World!
require 'glimmer-dsl-libui'

include Glimmer

window('hello world').show

Mac

glimmer-dsl-libui-mac-basic-window.png

Windows

glimmer-dsl-libui-windows-basic-window.png

Linux

glimmer-dsl-libui-linux-basic-window.png

Basic Table Progress Bar
require 'glimmer-dsl-libui'

include Glimmer

data = [
  ['task 1', 0],
  ['task 2', 15],
  ['task 3', 100],
  ['task 4', 75],
  ['task 5', -1],
]

window('Task Progress', 300, 200) {
  vertical_box {
    table {
      text_column('Task')
      progress_bar_column('Progress')

      cell_rows data # implicit data-binding
    }
    
    button('Mark All As Done') {
      stretchy false
      
      on_clicked do
        data.each_with_index do |row_data, row|
          data[row] = [row_data[0], 100] # automatically updates table due to implicit data-binding
        end
      end
    }
  }
}.show

Mac

glimmer-dsl-libui-mac-basic-table-progress-bar.png

Windows

glimmer-dsl-libui-windows-basic-table-progress-bar.png

Linux

glimmer-dsl-libui-linux-basic-table-progress-bar.png

Area Gallery
require 'glimmer-dsl-libui'

include Glimmer

window('Area Gallery', 400, 400) {
  area {
    path { # declarative stable path
      square(0, 0, 100)
      square(100, 100, 400)
      
      fill r: 102, g: 102, b: 204
    }
    path { # declarative stable path
      rectangle(0, 100, 100, 400)
      rectangle(100, 0, 400, 100)
      
      fill r: 204, g: 102, b: 204
    }
    path { # declarative stable path
      figure(100, 100) {
        line(100, 400)
        line(400, 100)
        line(400, 400)

        closed true
      }

      fill r: 202, g: 102, b: 104, a: 0.5
      stroke r: 0, g: 0, b: 0
    }
    path { # declarative stable path
      figure(0, 0) {
        bezier(200, 100, 100, 200, 400, 100)
        bezier(300, 100, 100, 300, 100, 400)
        bezier(100, 300, 300, 100, 400, 400)

        closed true
      }

      fill r: 202, g: 102, b: 204, a: 0.5
      stroke r: 0, g: 0, b: 0, thickness: 2, dashes: [50, 10, 10, 10], dash_phase: -50.0
    }
    path { # declarative stable path
      arc(200, 200, 90, 0, 360, false)

      fill r: 202, g: 102, b: 204, a: 0.5
      stroke r: 0, g: 0, b: 0, thickness: 2
    }
    
    on_mouse_event do |area_mouse_event|
      p area_mouse_event
    end
    
    on_mouse_moved do |area_mouse_event|
      puts 'moved'
    end
    
    on_mouse_down do |area_mouse_event|
      puts 'mouse down'
    end
    
    on_mouse_up do |area_mouse_event|
      puts 'mouse up'
    end
    
    on_mouse_drag_started do |area_mouse_event|
      puts 'drag started'
    end
    
    on_mouse_dragged do |area_mouse_event|
      puts 'dragged'
    end
    
    on_mouse_dropped do |area_mouse_event|
      puts 'dropped'
    end
    
    on_mouse_entered do
      puts 'entered'
    end
    
    on_mouse_exited do
      puts 'exited'
    end
    
    on_key_event do |area_key_event|
      p area_key_event
    end
    
    on_key_up do |area_key_event|
      puts 'key up'
    end
    
    on_key_down do |area_key_event|
      puts 'key down'
    end
  }
}.show

Mac

glimmer-dsl-libui-mac-area-gallery.png

Windows

glimmer-dsl-libui-windows-area-gallery.png

Linux

glimmer-dsl-libui-linux-area-gallery.png

Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)

Tcl/Tk has recently improved by gaining native looking themed widgets on Mac, Windows, and Linux in Tk version 8.5. Additionally, Ruby 3.0 Ractor (formerly known as Guilds) supports truly parallel multi-threading, making both MRI and Tk finally viable for support in Glimmer (Ruby Desktop Development GUI Library) as an alternative to JRuby on SWT.

The trade-off is that while SWT provides a plethora of high quality reusable widgets for the Enterprise (such as Nebula), Tk enables very fast app startup time and a small memory footprint via MRI Ruby.

Glimmer DSL for Tk aims to provide a DSL similar to the Glimmer DSL for SWT to enable more productive desktop development in Ruby with:

  • Declarative DSL syntax that visually maps to the GUI widget hierarchy
  • Convention over configuration via smart defaults and automation of low-level details
  • Requiring the least amount of syntax possible to build GUI
  • Bidirectional Data-Binding to declaratively wire and automatically synchronize GUI with Business Models
  • Custom Widget support
  • Scaffolding for new custom widgets, apps, and gems
  • Native-Executable packaging on Mac, Windows, and Linux

To get started, visit the Glimmer DSL for Tk project page for instructions on installing the glimmer-dsl-tk gem.

Glimmer DSL for Tk Samples
Hello, World!

Glimmer code (from samples/hello/hello_world.rb):

include Glimmer

root {
  label {
    text 'Hello, World!'
  }
}.open

Run (with the glimmer-dsl-tk gem installed):

ruby -r glimmer-dsl-tk -e "require '../samples/hello/hello_world.rb'"

Glimmer app:

glimmer dsl tk screenshot sample hello world

Hello, Notebook!

Glimmer code (from samples/hello/hello_tab.rb):

include Glimmer

root {
  title 'Hello, Notebook!'
   
  notebook {
    frame(text: 'English') {
      label {
        text 'Hello, World!'
      }
    }
     
    frame(text: 'French') {
      label {
        text 'Bonjour, Univers!'
      }
    }
  }
}.open

Run (with the glimmer-dsl-tk gem installed):

ruby -r glimmer-dsl-tk -e "require '../samples/hello/hello_notebook.rb'"

Glimmer app:

glimmer dsl tk screenshot sample hello notebook English glimmer dsl tk screenshot sample hello notebook French

Hello, Combobox!

Glimmer code (from samples/hello/hello_combobox.rb):

require 'glimmer-dsl-tk'

class Person
  attr_accessor :country, :country_options

  def initialize
    self.country_options=["", "Canada", "US", "Mexico"]
    self.country = "Canada"
  end

  def reset_country
    self.country = "Canada"
  end
end

class HelloCombobox
  include Glimmer
  
  def launch
    person = Person.new
    
    root {
      title 'Hello, Combobox!'
      
      combobox {
        readonly true # this applies to text editing only (item selection still triggers a write to model)
        text <=> [person, :country]
      }
      
      button {
        text "Reset Selection"
        command {
          person.reset_country
        }
      }
    }.open
  end
end

HelloCombobox.new.launch

Run (with the glimmer-dsl-tk gem installed):

ruby -r glimmer-dsl-tk -e "require '../samples/hello/hello_combobox.rb'"

Glimmer app:

glimmer dsl tk screenshot sample hello combobox glimmer dsl tk screenshot sample hello combobox dropdown

Glimmer DSL for XML (& HTML)

Glimmer DSL for XML provides Ruby syntax for building XML (eXtensible Markup Language) documents.

Within the context of desktop development, Glimmer DSL for XML is useful in providing XML data for the SWT Browser widget.

XML DSL

Simply start with html keyword and add HTML inside its block using Glimmer DSL syntax. Once done, you may call to_s, to_xml, or to_html to get the formatted HTML output.

Here are all the Glimmer XML DSL top-level keywords:

  • html
  • tag: enables custom tag creation for exceptional cases by passing tag name as '_name' attribute
  • name_space: enables namespacing html tags

Element properties are typically passed as a key/value hash (e.g. section(id: 'main', class: 'accordion')) . However, for properties like "selected" or "checked", you must leave value nil or otherwise pass in front of the hash (e.g. input(:checked, type: 'checkbox') )

Example (basic HTML):

@xml = html {
  head {
    meta(name: "viewport", content: "width=device-width, initial-scale=2.0")
  }
  body {
    h1 { "Hello, World!" }
  }
}
puts @xml

Output:

<html><head><meta name="viewport" content="width=device-width, initial-scale=2.0" /></head><body><h1>Hello, World!</h1></body></html>

Glimmer DSL for CSS

Glimmer DSL for CSS provides Ruby syntax for building CSS (Cascading Style Sheets).

Within the context of Glimmer app development, Glimmer DSL for CSS is useful in providing CSS for the SWT Browser widget.

CSS DSL

Simply start with css keyword and add stylesheet rule sets inside its block using Glimmer DSL syntax. Once done, you may call to_s or to_css to get the formatted CSS output.

css is the only top-level keyword in the Glimmer CSS DSL

Selectors may be specified by s keyword or HTML element keyword directly (e.g. body) Rule property values may be specified by pv keyword or underscored property name directly (e.g. font_size)

Example:

@css = css {
  body {
    font_size '1.1em'
    pv 'background', 'white'
  }
  
  s('body > h1') {
    background_color :red
    pv 'font-size', '2em'
  }
}
puts @css

Output:

body{font-size:1.1em;background:white}body > h1{background-color:red;font-size:2em}

Data-Binding Library

Data-Binding enables mapping GUI properties (like text and color) to Model attributes (like name and age) for bidirectional or unidirectional synchronization and conversion as needed.

Data-binding supports utilizing the MVP (Model View Presenter) flavor of MVC by observing both the View and a Presenter for changes and updating the opposite side upon encountering them. This enables writing more decoupled cleaner code that keeps View code and Model code disentangled and highly maintainable.

MVP

Glimmer enhances observed models automatically (including array operations like <<, delete, and reject!) on first observation. As such, you get automatic observable support, including nested and computed observations. No need to change your model code to data-bind it to the view or add repetitive boilerplate modules. View data-binding is truly decoupled from model logic by being able to observe any model attribute (Ruby attribute reader/writer combo or Ruby attribute reader alone for read-only data-binding when needed)

This relies mainly on the Observer Design Pattern and the MVP (Model-View-Presenter) Architectural Pattern (a variation on MVC)

These are the main classes concerning data-binding:

  • Glimmer::DataBinding::Observer: Provides general observer support including unique registration and deregistration for cleanup and prevention of memory leaks. Main methods concerned are: call, register (alias: observe), and unregister (alias: unobserve or deregister). Passing the option ignore_frozen: true at the end of the args of register (alias: observe) method results in silently ignoring any passed frozen observable without raising an error (it raises an error otherwise for frozen/immutable objects).
  • Glimmer::DataBinding::Observable: General super-module for all observables. Main methods concerned are: add_observer and remove_observer
  • Glimmer::DataBinding::ObservableModel: Mixin module for any observable model (Object, Struct or OpenStruct) with observable attributes (observes attribute writers and Struct/OpenStruct :[]= method). In addition to Observable methods, it has a notify_observers method to be called when changes occur. It automatically enhances all attribute setters (ending with =) to notify observers on changes. Also, it automatically handles observing array attributes using ObservableArray appropriately so they would notify observers upon array mutation changes. :attribute_writer_type option can be specified (default: :attribute=) to observe different attribute styles (e.g. attribute_writer_type: [:attribute=, :set_attribute]).
  • Glimmer::DataBinding::ObservableArray: Mixin module for any observable array collection that automatically handles notifying observers upon performing array mutation operations (e.g. push, select!, or delete) recursively (meaning if an array contained arrays and they changed, observers are notified). Accepts recursive: true option in add_observer method to recursively observe nested arrays all the way down. Alternatively, pass recursive: [integer] to limit recursion in Array observation to a specific number of levels beyond the first level (which is always included).
  • Glimmer::DataBinding::ObservableHash: Mixin module for any observable hash that automatically handles notifying observers upon performing hash mutation operations (e.g. hash[key]=value, select!, merge!). Also, it automatically handles observing array values using ObservableArray appropriately so they would notify observers upon array mutation changes.
  • Glimmer::DataBinding::ModelBinding: a higher-level abstraction that relies on all the other observer/observable classes to support basic data-binding, nested data-binding, and computed data-binding
  • Glimmer::DataBinding::Shine: enables highly intuitive and visually expressive syntax to perform bidirectional (two-way) data-binding with <=> and unidirectional (one-way) data-binding with <=

To do simple observation of models, arrays, or hashes, you can use the Glimmer::DataBinding::Observer::proc method, which builds an observer from a block. When invoking the #observe method on it, it automatically enhances the object argument being observed into an Observable (whether ObservableModel, ObservableArray, or ObervableHash).

Example of observing a model attribute:

Glimmer::DataBinding::Observer.proc do |new_value|
  # Do some work with new value for model attribute
end.observe(model, attribute)

Example of observing an array recursively (avoid recursion unless really needed since it fires on all fine-grained nested array changes):

Glimmer::DataBinding::Observer.proc do |new_value|
  # Do some work with new array value
end.observe(array, recursive: true)

Example of observing a hash key:

Glimmer::DataBinding::Observer.proc do |new_value|
  # Do some work with new value for hash key
end.observe(hash, :price)

Example of observing a hash for all key changes:

Glimmer::DataBinding::Observer.proc do |new_value, changed_key|
  # Do some work with new value and changed key for hash
end.observe(hash)

If you would like to observe nested model attribute changes, you can use the more advanced Glimmer::DataBinding::ModelBinding class instead.

Example of observing nested model attributes:

ModelBinding.new(model, "address1.street").add_observer do |new_address1_street_value|
  # Do some work with new address 1 street value
end

Example of observing indexed array changes (specifying an array index) (combined with a nested model attribute):

ModelBinding.new(model, "employees[5].name").add_observer do |new_employee_6_name|
  # Do some work with new employee 6 (index 5)'s name
end

Example of observing double-indexed nested array changes:

ModelBinding.new(model, "grid[5][7]").add_observer do |new_grid_cell_value|
  # Do some work with new grid cell value for row index 5 and column index 7
end

Example of observing keyed hash changes (specifying a hash key as Symbol or single/double-quoted String) (combined with a nested model attribute):

ModelBinding.new(model, "employees[:manager].name").add_observer do |new_employee_6_name|
  # Do some work with new manager employee's name
end

Data-bound ModelBinding attribute can be:

  • Direct: Symbol representing attribute reader/writer (e.g. [person, :name])
  • Nested: String representing nested attribute path (e.g. [company, 'address.street']). That results in "nested data-binding"
  • Indexed: String containing array attribute index (e.g. [customer, 'addresses[0].street']). That results in "indexed data-binding"
  • Keyed: String containing hash attribute key (e.g. [customer, 'addresses[:main].street']). That results in "keyed data-binding"

Data-binding options include:

  • before_read {|value| ...}: performs an operation before reading data from Model to update View.
  • on_read {|value| ...}: converts value read from Model to update the View.
  • after_read {|converted_value| ...}: performs an operation after read from Model to update View.
  • before_write {|value| ...}: performs an operation before writing data to Model from View.
  • on_write {|value| ...}: converts value read from View to update the Model.
  • after_write {|converted_value| ...}: performs an operation after writing to Model from View.
  • computed_by attribute or computed_by [attribute1, attribute2, ...]: indicates model attribute is computed from specified attribute(s), thus updated when they are updated. That is known as "computed data-binding".

Note that if an observed model attribute or hash key is an Array, it is automatically observed for Array changes (e.g. via mutation methods <<, delete, map!), not just attribute/key-value changes.

All of the features above make Glimmer's data-binding library one of the most sophisticated and advanced in the industry since it automates everything instead of requiring endless manual configuration, thus resulting in some of the tersest most declarative syntax for using observers and data-binding.

You may learn more by looking into data-binding specs as well as Data-Binding and Observer usage in Glimmer DSL for SWT

Shine Data-Binding Syntax

The Shine data-binding syntax is a highly intuitive and visually expressive way of data-binding that enables performing bidirectional (two-way) data-binding with the <=> operator and unidirectional (one-way) data-binding with the <= operator.

It is facilitated by the combination of the Glimmer::DSL::ShineDataBindingExpression and Glimmer::DataBinding::Shine classes, which depend on Glimmer::DSL::BindExpression and Glimmer::DataBinding::ModelBinding.

Below are some examples of Shine usage in GUI DSLs:

text <=> [contact, :first_name]

This example bidirectionally binds the text property of a widget like label to the first name of a contact model.

text <=> [contact, 'address.street']

This example binds the text property of a widget like label to the nested street of the address of a contact. This is called nested property data binding.

text <=> [contact, 'address.street', on_read: :upcase, on_write: :downcase]

This example adds on the one above it by specifying converters on read and write of the model property, like in the case of a text widget. The text widget will then displays the street upper case and the model will store it lower case. When specifying converters, read and write operations must be symmetric.

enabled <= [user, :logged_in]

This example unidirectionally binds the enabled property of a widget like button to the logged in status of a user.

enabled <= [user, :logged_in, on_read: :!]

This example unidirectionally binds the enabled property of a widget like entry to the negated logged in status of a user. Note that when using a single on read converter with unidirectional data-binding, there is no need for a symmetric on_write converter as well since writing is never done with unidirectional (one-way) data-binding.

Learn more about Shine data-binding syntax from its usage in Glimmer DSL for SWT

Glimmer Process

Glimmer Process is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. Glimmer Process is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.

Learn more by reading the GPG (Glimmer Process Guidelines)

FAQ

(Frequently Asked Questions)

How do Glimmer GUI DSLs compare to Shoes?

If you liked Shoes, you'll love Glimmer!

That is because Glimmer does everything that Shoes did, but with a lighter and better GUI DSL (Graphical User Interface Domain Specific Language) that addresses all the issues that Shoes suffered from, such as:

  • Shoes does not allow code in Shoes blocks to use variables defined outside of Shoes blocks in a straightforward manner as it changes self inside Shoes blocks, breaking Ruby expectations and producing confusing behavior. On the other hand, Glimmer DSL blocks are 100% standard Ruby blocks that represent real closures, so they enable usage of variables defined outside the blocks in a 100% standard Ruby way.
  • Shoes lacks support for high-quality business widget controls (View components) like table and tree. Glimmer GUI DSLs that are feature complete like Glimmer DSL for SWT do support table and tree widgets. Some non-final Glimmer GUI DSLs like Glimmer DSL for LibUI support the table control too.
  • Shoes does not encourage proper separation of concerns with a correct MVC architecture (Model-View-Controller), resulting in a lot of non-presentation logic mixed with View code. Glimmer GUI DSLs do support proper separation of concerns 100% following the MVC or MVP (Model-View-Presenter) architecture by default.
  • Shoes does not provide a simple way for connecting View components to Model data. Glimmer GUI DSLs provide full bidirectional/unidirectional data-binding support out of the box that provides the terest code syntax for connecting Views to Models and keeping them in sync.
  • Shoes does not support a native mechanism for building custom View components. Glimmer GUI DSLs do support the ability to build custom widgets (aka controls or View components), custom windows (aka shells), and custom shapes (canvas graphics), enabling software engineers to expand a Glimmer DSL’s vocabulary with new keywords representing brand new visual concepts. That results in much higher productivity by enabling the reuse of higher visual concepts as their own self-encapsulated components.
  • Shoes does not expose native features of its wrapped GUI toolkit. Glimmer GUI DSLs do expose all native features of their wrapped GUI toolkits, thus enabling developers to use a GUI toolkit like SWT directly when needed on top of using Glimmer DSL for SWT (a widget initialized via SWT directly could be passed to Glimmer DSL for SWT to wrap as a Glimmer WidgetProxy object and integrate with other Glimmer initialized WidgetProxy objects). That facilitates the 80/20 rule of having Glimmer GUI DSLs automate 80% of the work while still enabling software engineers to reach down to the low-level GUI toolkit API in 20% of the cases when needed (though in practice, it's probably more like 1% of the cases).

It is great that Shoes paved the way for creating desktop GUI DSLs in Ruby. Glimmer took that approach to its maximum and produced the ultimate evolution of Shoes.

What is the difference between Glimmer and Glimmer DSL for SWT?

Glimmer DSL for SWT was the first GUI DSL created as part of the Glimmer project to enable building desktop applications, and it was originally just called Glimmer. It relied on the Eclipse SWT library to render native GUI (Graphical User Interface) widget controls (View components) on every platform (Mac, Windows, and Linux). Eventually, the idea of a Glimmer DSL proved itself so successful and viable for building desktop apps with a fraction of the effort needed in other programming languages/technologies that it was expanded to support other GUI toolkits. So, Glimmer got renamed to Glimmer DSL for SWT, and the core Glimmer DSL engine got extracted to Glimmer (becoming a DSL framework), which then got reused to build other Glimmer GUI DSLs such as Glimmer DSL for LibUI and Glimmer DSL for GTK, among many others.

What is the difference between Glimmer DSL for SWT and Glimmer DSL for LibUI?

Both Glimmer DSL for SWT and Glimmer DSL for LibUI support rendering platform native widgets/controls, which enable building native desktop apps that look 100% native on every platform (Mac, Windows, and Linux).

However, Glimmer DSL for SWT runs in JRuby (Ruby running in the JVM [Java Virtual Machine]) whereas Glimmer DSL for LibUI runs in standard Ruby (aka MRI Ruby or CRuby).

Glimmer DSL for SWT is 100% feature-complete and has a final release. Glimmer DSL for LibUI is 100% complete as far as covering the LibUI features, but LibUI itself is still a mid-alpha library, so it is missing a few features that will get added eventually.

What is the difference between Glimmer DSL for LibUI, Glimmer DSL for GTK, Glimmer DSL for Tk, Glimmer DSL for FX, and Glimmer DSL for WX?

All of Glimmer DSL for LibUI, Glimmer DSL for GTK, Glimmer DSL for Tk, Glimmer DSL for FX, and Glimmer DSL for WX run in standard Ruby (aka MRI Ruby or CRuby).

However, only Glimmer DSL for LibUI and Glimmer DSL for WX render native controls on every platform. The other libraries do not render native controls on every platform, albeit Glimmer DSL for GTK renders native controls on Linux distributions utilizing Gnome.

Also, Glimmer DSL for LibUI does not require any prerequisites beyond installing the Ruby gem, so you can install it and get instant GUI with very little effort, whereas Glimmer DSL for GTK, Glimmer DSL for Tk, Glimmer DSL for FX, and Glimmer DSL for WX do require extra dependencies in general, albeit Glimmer DSL for GTK has everything it needs in Linux Gnome flavors and both Glimmer DSL for FX and Glimmer DSL for WX have everything they need on Windows by including pre-built binaries.

You may learn more about the differences between various Glimmer DSLs by checking out the Glimmer DSL Comparison Table.

What is the difference between Glimmer DSL for SWT, Glimmer DSL for Swing, and Glimmer DSL for JFX?

Glimmer DSL for SWT relies on the Eclipse SWT library, which renders native widgets on every platform (Mac, Windows, and Linux) to build desktop apps that look 100% native on every platform (Mac, Windows, and Linux).

Glimmer DSL for Swing relies on Swing, which does not render native widgets on every platform. Glimmer DSL for JFX relies on JavaFX, which also does not render native widgets on every platform.

Also, SWT initializes native widgets in memory using non-Java code (e.g. C/C++), thus ensuring native OS high performance for rendering native widgets without being prone to Java garbage collection pauses. On the other hand, Swing and JavaFX initialize non-native widgets in memory using Java code, thus depend on the performance of the Java Virtual Machine while being prone to Java garbage collection pauses. As a result, SWT provides a better user experience than Swing and JavaFX.

You may learn more about the differences between various Glimmer DSLs by checking out the Glimmer DSL Comparison Table.

Why not just use SWT, LibUI, GTK, Tk, FOX Toolkit, wxWidgets, Swing, or JavaFX from Ruby directly?

GUI Toolkits implement low-level GUI rendering concerns. And, while some of them do offer object-oriented APIs, their APIs are very verbose and imperative by design due to being low-level APIs. As such, they require software engineers to write a lot more low-level code that does not map intuitively to the structure of the GUI visually, slowing down productivity and making maintainability more expensive.

Glimmer GUI DSLs on the other hand are fully declarative and follow Rails' Convention Over Configuration maxim by including smart defaults and automation of low-level details, so they enable software engineers to write the simplest most minimalistic code that maps to the actual visual GUI concepts, maximizing productivity and resulting in code that is very maintainable and intuitive to reason about.

Furthermore, Glimmer GUI DSLs offer advanced Bidirectional/Unidirectional Data-Binding Support, which enables syncing View data with Model attributes with the tersest code syntax possible to greatly simplify reasoning about the code while supporting proper separation of concerns through correct adherence to MVC (Model-View-Controller) and MVP (Model-View-Presenter).

That's in addition to scaffolding and native executable packaging in some Glimmer GUI DSLs. As a result, productivity increases even further and maintainability becomes even less expensive, thus enabling software engineers to deliver pieces of software in a matter of minutes or hours for desktop application MVPs (Minimal Viable Products). As such, Glimmer GUI DSLs significantly shorten the feedback cycle and enable incrementally releasing features at a very fast pace, not possible with GUI toolkit low-level APIs.

Resources

Help

Issues

You may submit issues on GitHub.

Click here to submit an issue.

Chat

If you need live help, try to Join the chat at https://gitter.im/AndyObtiva/glimmer

Feature Suggestions

These features have been suggested. You might see them in a future version of Glimmer. You are welcome to contribute more feature suggestions.

glimmer-dsl-swt/TODO.md

Glimmer DSL Engine specific tasks are at:

TODO.md

Change Log

glimmer-dsl-swt/CHANGELOG.md

CHANGELOG.md

Contributing

Contributors Wanted!

If you would like to contribute to Glimmer, please study up on Glimmer and SWT, run all Glimmer samples, and build a small sample app (perhaps from this TODO list) to add to glimmer-dsl-swt Hello or Elaborate samples via a Pull Request. Once done, contact me on Chat.

You may apply for contributing to any of these Glimmer DSL gems whether you prefer to focus on the desktop or web:

CONTRIBUTING.md

Contributors

Click here to view contributor commits.

Hire Me

If your company would like to invest fulltime in further development of the Glimmer open-source project, hire me.

License

MIT

Copyright (c) 2007-2024 - Andy Maleh.

--

Glimmer logo was made by Freepik from www.flaticon.com

glimmer's People

Contributors

andyobtiva avatar gitter-badger avatar soleone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glimmer's Issues

[Idea] "Standardized" glimmer components

Hey there Andy,

This is just an idea again, please feel free to ignore/close at any moment in time.

Recently I have been playing again with libui-ng a bit, just to polish a few things.

I also saw kojix2 simple notepad example - somehow I missed that in my own gem.

When I was testing the notepad a bit, I wondered ... this could be made more
fancy and useful. For instance, a widget on the left side that keeps track of
the numbers, so if there are 100 lines in the notepad, separated via newlines,
the widget on the left side could count from 1 to 100. And thus indicate on
which line one is. This is probably already possible via libui-ng, or, at the least
would not be as difficult. On windows this could even be useful, like a notepad
replacement but in ruby. Or a whole IDE via ruby + libui-ng on windows! :)

This then made me wondered ... what if glimmer would offer that, or perhaps it
already offers it?

So it brought me towards ... "what if we could have ready-made glimmer
components", like this small enhanced notepad. Or ideally different
notepad styles to allow people to customize it.

Now I know you are using the glimmer-swt editor (I think) or at the least there
is one. But I believe that one requires java. I am more wondering minimalistic,
if possible, like, just ruby (and libui, but the kojix2 libui bindings should be
enough via gem installation).

Something a bit of a "glimmer ecosystem" that can be adjusted to different
users and needs. Perhaps based on some config format or so or a yaml file
and/or commandline flags. Just a made-up example:

glimmer --start-simple-editor
glimmer --start-slightly-enhanced-editor # not a good word but I think you get the idea

And so on.

So, for instance, I could have that widget on windows, and interconnect it somehow
with features or functionality. Like save-file functionality - that one is probably
available in every editor. And a few more things.

Something people could re-use via glimmer and it would work on as many platforms
and use cases (including in use via a browser, if possible), if you kind of understand
what I mean. It ties a bit into the app-store for glimmer (the glimmerstore!) a bit,
so I am not saying you should maintain and create all of that, mind you. Plus, you
already provide many examples here (tetris and so forth). I am more thinking of
functionality and components people could "browse through" like in a catalog
and cherry-pick when possible; and in the cases where they integrate it into
their own code base, they could use ruby code, e. g. like:

widget1 = "glimmer, return here a simple clock"
widget2 = "glimmer, return here an editor of medium complexity with feature set a, b, c, d"
window.add(widget1, widget2)

Or something like that if you understand what I mean. It is probably already possible,
to some extent, or perhaps it is not, in which case it may perhaps be useful to offer
something like that.

The reason I used the word "standardized" is more like pointing to one place where this
could all be collected. So, for instance, it could also be all made available in a glimmerstore,
or it could just be in some kind of meta-DSL that describes things. The above is just an
example, can be another functionality or API of course. Kind of like LEGO building bricks.

(And, perhaps one day if glimmer becomes meta-mega-cross-language, like say in
+10 years, then we could refer to a "standardized" set of widgets that are flexible and
customizable.)

Anyway. This is just a rough idea. I hope it is not too confusing - it's a lot easier to have
a mental picture rather than try to describe it for others to understand the idea as well. :)

Add support for slint-ui

Describe the issue

https://slint-ui.com/ is a rust powered ui with low memory requirements. Now that cargo extensions can be installed with rubygems- it would be nice to have a ruby gem that connects to slint-ui and glimmer support for this.

[Proposal] A new glimmer FAQ repository to specifically answer FAQ-related questions from different users

Universal Glimmer FAQ

Hey there Andy - long time no opening new issue trackers by me. :D

You provide at the least one FAQ, which is here:

https://github.com/AndyObtiva/glimmer?tab=readme-ov-file#faq

I am not sure if there are more FAQ-entries in regards to glimmer
than this one though.

The FAQ shown above currently answers 6 questions.

I would like to suggest a "Universal Glimmer FAQ", spanning ALL
glimmer-related aspects, but also questions as to how real people
may use Glimmer.

With that I, sort of, mean one central place where the Glimmer
FAQ could be situated at.

I also, specifically, mean really small-ish questions too, such
as "how to style xyz" - such as the glimmer-editor (glimmer-cs-gladiator).

Now you may interject and state that this fits more to the corresponding
github page for the glimmer subsuite at hand, such as glimmer-gtk,
glimmer-tk and so forth. I understand this, but I also think that having
one unified place for a glimmer FAQ - which I see more as a "practical
documentation" would be better. It may make it easier for people
to find something interesting or even learn something new.

In order to accomodate this, I would like to suggest adding a new
github repository, specifically as a glimmer FAQ, inviting people to
ask glimmer-related questions.

You could try this, and if it works then this is great - if it does
not work, you could always merge it back into the glimmer main
repository and delete that new github account, so this should be
low risk approach.

I also have some glimmer-related questions, but I feel that it may be
better to add them to such a new github page, rather than spam down
the main github repository with FAQ-related questions.

As always please feel free to proceed as you may deem fit, including
disregarding this issue request and closing it as you deem fit.

[Idea / Suggestion] "Glimmer components": the idea is to have different glimmer widgets, no matter the style, that could be integrated / included and re-used. For instance, rubio-radio to be embedded in a tabbed notebook with a weather-displaying widget

[Idea / Suggestion] Glimmer for president erm ... "Glimmer components"

Hey there Andy,

My apologies for this rush of ideas. Please don't waste too much time
thinking about all the work implementing these ideas would bring. I
am more interested to see how glimmer evolves and changes and
improves; not all ideas I suggest are great. They are fragments of
a chaotic mind ... :D

Recently you (and I suppose kojix2 too) worked on ruby-radio, I mean,
rubio-radio. You mentioned this on your blog at
https://andymaleh.blogspot.com/ lately.

(I have not yet checked it on windows. A lot of the GUI I do is
actually for windows really, because on linux the commandline
works very well for my own personal use case. But I have a few
elderly relatives who have all sorts of health problems, so
I am trying to make things a bit better there - but also for
selfish reasons, so I can try to keep the time investment to
help them lower, so I can focus on other things lateron.
That's one big reason for me why I invest more time into
GUIs. But GUIs are also quite interesting in general, IMO -
I remember Alan Kay's old lectures, if you haven't watched
them yet, it's quite interesting how he spoke about really
old GUIs. But I digress so back on topic.)

So let's assume rubio-radio works, and is feature complete
and is described via the glimmer DSL. Ok, all is fine.

I am also working on a small libui widget for windows that
helps me compile things there. Perhaps via msys2 and gcc,
but I also want to try cl.exe from Visual Studio and see
whether I can use it correctly; and whether I may turn
autoconfigure-based projects into working "Makefiles".
(I have a set of scripts that I could adapt here.)

Anyway. This is just a lengthy introduction so far. Sorry
for that.

Now let's say I am bored on windows, and while I am compiling
something, I want to listen to rubio-radio!

I can have two different widgets, so one for the compile related
GUI; and one rubio-radio. But I could also want to combine these
two, via a tabbed notebook. First tab is the compile widget,
second one rubio-radio.

This is just an example. I am sure you can find many more examples
similar to this. And perhaps we can have a big libui desktop-like
widget set too! But anyway.

So my idea is ... "ok, the code for rubio-radio works
and I want to integrate it ... but how?".

This is where "components" come into play.

My idea would be that glimmer itself could return/yield
the widgets for such components. So we probably omit
the window, and just get the "core" (the "meat" of
it, if you don't mind - vegetarians may not relate
to this so let's settle for "core") of an application.

So once I have the core, I could attach/add it to the tabbed
notebook, for instance. Or vice versa, we could use glimmer
DSL to attach/add different widgets, even those written by
kojix2 in the examples output (for the glimmer gem he maintains).
That would actually be the best, I think, if glimmer could
integrate these examples via a tabbed interface (notebook
like widget). But this is only an example. Of course we
could use a grid or vbox/hbox, but I think tabs make sense
for the user since you can kind of shift between them in
the same application, rather than having open several
different GUI applications at the same time.

The ideal thing would be where we could integrate all different
libui projects, no matter the "style" (DSL, or classic/original
verbose LibUI or monkey-patching fiddle).

I write this a lot about libui, but this could be extended to
the whole glimmer suite, where we can integrate glimmer with
other widgets, even if they don't use the glimmer DSL. I assume
you would prefer more applications in the glimmer DSL, but it
is not necessarily trivial to learn (well, not for everyone),
so this could be a baby step towards people becoming more
familiar with glimmer slowly, and gradually.

I don't know if and how you have a modular structure in glimmer
that would allow for this, and I am not proposing that this is
implemented when it takes too much time, so no worries - it's
meant just as an idea really. But if you ever come around to
think about this, it could be useful for people in general, for
when they use glimmer. Kind of like an additional entry point
eventually. I imagine something like the old superkaramba,
where people would write tons of glimmer-related applications.
(This may also need better styling support e. g. to make it
look pretty. But functionality is more important than pretty
at the least as a FIRST step. I usually focus on the
functionality first, and then afterwards I focus more on
styling or adapting it. I do that with HTML/CSS as well
as with ruby-gtk3. With libui obviously this is a bit more
limited right now but who knows what will happen in the
future.)

The ideal situation would be like a meta-glimmer or meta-meta-glimmer
where we can integrate and re-use widgets written/defined by different
people seamlessly. Like an "AppUniverse" for glimmer. And perhaps even
in different programming language (well ... if rubocop could perhaps
be repurposed to translate from ruby to crystal that would be pretty
cool - I imagine a speed improvement there if that would work well).

Anyway - this is just a rough idea. Don't worry too much about
implementing this.

Glimmer on! \o/

PS: I mentioned the weather-displaying widget. I forgot where but I think
you wrote one somewhere. Not sure if there is a variant for libui. Something
simple if it does not exist may be nice, if it does not exist yet. Or I simply
forgot where it was or misremember hmmm ...

Problem with initial scaffolding - no auto Rakefile creation then "no implicit conversion from nil to integer"

mkdir some_app
glimmer scaffold[some_app]
Successfully installed juwelier-2.4.9
1 gem installed
No user.name found in ~/.gitconfig. Please tell git about yourself (see http://help.github.com/git-email-settings/ for details). For example: git config --global user.name "mad voo"
Created some_app/.gitignore
Created some_app/.ruby-version
Created some_app/.ruby-gemset
Created some_app/VERSION
Created some_app/LICENSE.txt
Created some_app/Gemfile
warning: thread "Ruby-0-Thread-1: /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:187" terminated with exception (report_on_exception is true):
#Class:0x5c7e92df: No such file or directory - Rakefile
sysopen at org/jruby/RubyIO.java:1237
read at org/jruby/RubyIO.java:3774
gem_rakefile at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:419
app at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:136

at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task.rb:113
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
each at org/jruby/RubyArray.java:1809
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:214
mon_synchronize at /opt/jruby/lib/ruby/stdlib/monitor.rb:235
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:194
invoke at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:183
launch at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:140
launch_application at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:188
#Class:0x5c7e92df: No such file or directory - Rakefile
sysopen at org/jruby/RubyIO.java:1237
read at org/jruby/RubyIO.java:3774
gem_rakefile at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:419
app at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:136
at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task.rb:113
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
each at org/jruby/RubyArray.java:1809
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:214
mon_synchronize at /opt/jruby/lib/ruby/stdlib/monitor.rb:235
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:194
invoke at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:183
launch at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:140
launch_application at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:188

So ... I help it along by creating the some_app/Rakefile and retry:

nano some_app/Rakefile
glimmer scaffold[some_app]
Successfully installed juwelier-2.4.9
1 gem installed
No user.name found in ~/.gitconfig. Please tell git about yourself (see http://help.github.com/git-email-settings/ for details). For example: git config --global user.name "mad voo"
Created some_app/.gitignore
Created some_app/.ruby-version
Created some_app/.ruby-gemset
Created some_app/VERSION
Created some_app/LICENSE.txt
Created some_app/Gemfile
warning: thread "Ruby-0-Thread-1: /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:187" terminated with exception (report_on_exception is true):
#Class:0x7cdecc64: no implicit conversion from nil to integer
insert at org/jruby/RubyArray.java:1101
gem_rakefile at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:422
app at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:136

at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task.rb:113
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
each at org/jruby/RubyArray.java:1809
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:214
mon_synchronize at /opt/jruby/lib/ruby/stdlib/monitor.rb:235
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:194
invoke at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:183
launch at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:140
launch_application at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:188
#Class:0x7cdecc64: no implicit conversion from nil to integer
insert at org/jruby/RubyArray.java:1101
gem_rakefile at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:422
app at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task/scaffold.rb:136
at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/rake_task.rb:113
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
each at org/jruby/RubyArray.java:1809
execute at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:273
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:214
mon_synchronize at /opt/jruby/lib/ruby/stdlib/monitor.rb:235
invoke_with_call_chain at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:194
invoke at /opt/jruby/lib/ruby/gems/shared/gems/rake-12.3.2/lib/rake/task.rb:183
launch at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:140
launch_application at /opt/jruby/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.2.2/lib/glimmer/launcher.rb:188

This happens no matter what I try --> it just gets stopped here.

[Tutorials, Documentation and Glimmer] Just for some thought, not necessary "actionable"

Hello Andy,

This is just meant as a few random thoughts.

Monitoring your blog like a hawk I noticed you added videos to explain stuff (I
assume you cater primarily to newcomers). This is, if correct, a good idea IMO.

I have a small suggestion to make in the long run: perhaps you could make
a "series" of videos/blog-videos/vlogs or however you want to call them,
with something that is easy-to-watch. With that I mean ... well, I noticed
my attention span went downhill due to youtube, but I think a good range
is something between 5-15 minutes, perhaps more closer towards 10
minutes or so - something that should be reasonable, not too long, but
not too short either. Then via a series people could work through the
steps and learn more. Now, different people may learn things differently,
some prefer videos, I actually prefer examples that I can tweak and
watch the results, but to each their own.

The web-related aspect is perhaps the most important one these days.
While, I think, you invested a lot of time into the java/swt-specific
stuff (the editor you wrote and the various other GUI "snippets"),
I think in many ways most people probably cater to the world wide
web these days. So the rails/opal stuff is probably something that
may interest more people than, say, glimmer-dsl-gtk. (Not trying
to discredit ruby-gtk, I like ruby-gtk3 + the CSS rules, but if you
count the total amount of downloads for gtk3, it is currently at
256_793 and that is ... in almost 10 years. So it's a really small
user base unfortunately. I assume for the world wide web the
user base is larger; for instance, opal has more than 500.000
downloads already and it has been around for almost as long
as ruby-gtk3. But I digress, so back to the main topic.)

I think what may be useful or helpful for people, if you plan to
extend the video series (and, mind you, this is NOT a request
to invest a lot more time outside of your regular pace, this
is just more a semi-random long-term thought here, time
is always a limited resource so priorities have to be set), then
perhaps it could be somewhat organised to focus on different
topics. You already do that, kind of, in your videos, but I just
wanted to mention it again.

This brings me to a semi-related thought ... I'll explain this in
a moment.

Many years ago _why the lucky stuff was active. I don't know
if you remember him (you probably do, perhaps due to his
comic). He had many interesting projects, one was the sandbox
(which actually led to the creation of BasicObject, if I remember
correct; back then I asked him whether I can obtain the source
of his sandbox which was available back then as REPL on a
webpage but he said the quality of the code was too bad so
I did not get the code ... :P). Another interesting project was
the original shoes. This one was, I believe, written in C, whereas
shoes nowadays is written in java.

In some ways I think shoes is a BIT similar to perhaps glimmer
libui. It's not the same but I think we can find some marginal
overlaps. I don't know if you remember or know the original
shoes.

So here is a second semi-random thought: IF you plan to
make the video series available, then perhaps you could
also add more code to the controller, for people to watch
the video as-is; this could simply be a "hardcoded" path
to the browser for the URL (e. g. to use the gem "launchy"
or a similar way to just open it as people run any glimmer
GUI), or if this ever becomes more sophisticated, then
even a video watching this ... in glimmer!

I don't suggest to implement a video player, no worries.
But like to "embed" mplayer or mpv or something like
that. On Linux at the least it is possible to embed videos
via xid. I tried this in ruby-gtk3, and it kinda works but it is
super-hackish. Perhaps support for this may become
better one day, like in gstreamer and ruby-gtk4. But again,
these are just semi-random thoughts. I just thought it would
be kind of cool to be able to view these videos from within
glimmer. :)

This now leads me to the next semi-random thought. Some
time ago I wondered about something like glade-for-glimmer.
I did not mean this to get people to have to use XML, but more
like as a general DSL layer (or a DSL-over-a-DSL layer) -
something that helps the average person build and adjust
GUIs. Now, again, don't get too distracted with this, but I kind
of thought this also to be nice. Like people just create GUIs
within ... a glimmer GUI! A bit similar to how glade is used,
but perhaps like a full GUI suite for building stuff. A bit like
the editor you wrote, but something that Average Joe could
use (in theory; in practice I guess it requires too much work
and may not be worth the time investment, but I just think
it would be cool. Tons of people could use that, write widgets
that would work, even if a toolkit vanishes.)

I also wanted to suggest to consider looking whether you may
want to help kojix2 in supporting libui if only for small things,
but I noticed you already requested to be added. I got the
email invite a few hours ago so I guess kojix2 may read that
come japanese "regular" hours and send an invite too,
so glimmer-on, libui-on, GUI-all-the-things!

Last but not least, and then I am done with this lengthy thoughts-idea,
on your blog to mention the GUI/Apps for rails/opal and show this
screenshot:

https://raw.githubusercontent.com/AndyObtiva/sample-glimmer-dsl-opal-rails7-app/master/sample-glimmer-dsl-opal-rails7-app.png

This is fine, but what if each button could show some image too, how this
may look? Something that is not too large, like 48px x 48px or so. Kind of
how you show things on the glimmer-dsl-swt webpage, the part:
"Here is a listing of supported widgets taken from the [SWT website".
Images like that. But this is just a thought - the rationale I am having
for this is that it may instantly give newcomers a visual look when they
start it, to see what a checkbutton is, how it may look like, before they
click on the button that starts it. (The image can be part of the button
or next to the button, that is just a detail I think; the more important
part is to quickly and easily show people how this may look. Ideally
it may be how it looks on the web+opal, but you could also standardize
and just show a semi-"generic" image as average on how this MAY
look. Although I guess having it specific to the toolkit may be best.
I don't suggest to do screenshots like that manually though. Perhaps
there is some automated way to make screenshots; I think headless
chrome or so allows that, but I don't know enough to be able to say
how easy that is. I am more like thinking that manual time investment
may be too much, but you could always perhaps just see how this
may look for the first three images, and if it does not look that great
perhaps drop that idea before investing too much time. But as said,
that's just some random ideas, I'll end this now. Sorry for creating
so many issue trackers. :D)

[Discussion / Suggestion] Would or could GraalVM + native-image be considered as a useful distribution option for glimmer-related applications?

Hey there Andy,

This is a bit long, so for the "Too long, did not read" summary associated with this issue request - more a
discussion or question - please see the last line of this issue request. You can easily skip what is "in
between" I think; I tend to write too much. :)

This is more a discussion/question/suggestion. You most likely know about GraalVM and probably already used it
considering you must know java fairly well (see glimmer-dsl-swt for instance and the associated applications
and the associated GUIs, which I assume require some or considerable knowledge of java already as-is).

I remember perhaps two months ago or so the discussions between you and kojix2 in regards to libui + orca and
distributing applications in general. Libui makes this quite useful on windows too - at the least I could get GUIs
to work on windows "out of the box" just fine. Hopefully some hero-dev can keep on maintaining the upstream
libui in the event that andlabs does not have the time / resources to do so, but I digress.

A few weeks ago or so I used native-image from GraalVM for the first time and built a standalone binary which could
be size reduced to about 4 MB or so (in total size; there is some external tool like uxp or something like that
that can reduce the size to that). While that is still quite large, ultimately I don't really care so much
about the overall size as long as things work, and it actually seems faster than what I use on windows, e. g.
"java HelloWorld" takes longer than the native-image produced via GraalVM. And that's quite neat, feels
almost as fast as a compiled .exe from C, on windows. (On Linux things are quite fast, in my experience -
on windows I always struggle when copy-operations are done. Copying from my external USB HDD takes
sooooo much longer on windows than it does on linux ... :( )

The polyglot functionality in GraalVM is also quite interesting - one idea I had was to combine youtube-dl with
some ruby-GUI or something like that. And there are blog entries of people that got swing to work with
GraalVM (I failed to reproduce this, but it is said that swing support will work eventually via GraalVM;
javafx works already as far as I am aware so that may also be an option; and the polyglot "polylanguage"
approach should allow people to combine quite a bit, yes? A bit like jruby tapping into .rb files).

Have you considered looking at GraalVM + native-image? Would be quite neat if the glimmer-suite may
eventually support that combination, if possible. Perhaps this is too much work right now considering that
GraalVM is changing a lot, but who knows, perhaps in a year or two it would be interesting to see whether
this could be an option. I am still a java noob, though, but I wanted to mention it in the event that this
was not yet considered for glimmer - or, in the event that it was considered, some obstacles may exist
that make it not as easy. I haven't yet used the Glimmer DSL for SWT but I keep reading updates,
e. g. the perfect-shape gem and custom shapes you recently extended. On that note, by the way, it
would be interesting if these shames could be shown on each variant e. g. tk, gtk, libui, swt, if only
to compare it. Not so much the draggable functionality per se, but simply how to render these shapes
in the different toolkits - but this is a secondary comment, since your available time is not infinite. The
primary TL; DR is:

  • Has GraalVM + native-image been considered as a viable, additional "distributable" strategy for
    the glimmer suite?

A few ~smaller suggestions, kind of; in particular 2-3 or so suggestions for expanding the FAQ entries

Hey there Andy,

This bundles a few issue requests into one; I hope that's ok. I wanted
to keep it focused rather than write several issue requests.

You provide a FAQ here:

https://github.com/AndyObtiva/glimmer#faq

This is helpful because I am extremely forgetful; all the multi-tasking
means I get distracted again and again. Sometimes I just don't know
of things I used to know a few months ago. At any rate, to the issue
request.

You provide various applications/GUIs in glimmer. Every once in a while
I check for news on https://andymaleh.blogspot.com/.

  1. Is it possible to download a specific glimmer application, from
    the commandline; including a specific toolkit?

For instance, just as an example:

glimmer --download=snake # download all snake impementations availble
glimmer --download=libui-snake # or something like that
glimmer --download=libui-snake-app
glimmer --download=swt-snake-app
glimmer --download=gtk-snake-app
glimmer --download=web-snake-app

So basically a way to specifically download one, or more than one,
apps, via the commandline. We can download just fine via github;
I just wondered whether there is a simple "up-and-running" command
to try glimmer applications. And yes, I can also easily copy/paste
the code shown :) - I am just more thinking the line of thought of
super-lazy people who just want to copy/paste something into the
terminal. :D

  1. IF there is a commandline way, could you also provide an example
    for this into the FAQ, including a few examples? You provide a LOT
    of documentation, which is great, but a FAQ can also be super-useful
    in that it can show a command concisely. Not many examples are needed,
    perhaps 1-3 or so IF such a feature exists. (If not then please
    disregard this suggestion.)

  2. Is there a way to obtain an up-to-date overview of what is all
    available, including the toolkits?

With that I mean something that can easily show up-to-date implementation
details of different toolkits AND applications.

For instance, the natalie language has a simple chart to show which
percentage of the ruby language specification has been covered via
tests so far, at https://natalie-lang.org/.

This is nice in that we can get a quick overview of how far a project
has progressed. For glimmer, of course a graph would be great too,
but I am thinking of even simpler means here, a markdown table may
suffice (even better if it can be autogenerated and autoupdated
so you don't have to do much manual time investment).

The rationale behind this question is primarily this:

  • e. g. to show which applications are available; see the older
    "glimmer store" suggestion. While that was more meant in a browser
    to view what is available, here I am thinking more of a commandline
    variant to see the progress. For instance:

    glimmer --statistics # or if that is already in use, perhaps --percentage

Just something to keep track of things in glimmer, especially when
people have not checked on glimmer for a few months and want to see
what's new.

  1. If something like this is added or available, to also add a FAQ
    entry or something, just as a quick pointer. Can be a very short
    entry.

  2. A new FAQ entry: "could glimmer be used for other programming
    languages as well?"

Here I mean whether one could, say, use python to implement a
glimmer spec.

Which brings me to:

  1. Will there be a glimmer specification eventually? Something a
    bit like Rack, in where we describe an application ideally in
    just one glimmer DSL "to rule them all", and have lots of applications
    available. Would be kind of great if glimmer would become a
    general purpose GUI-DSL; while the focus is evidently on ruby,
    and perhaps java (does it work via swing? I haven't checked
    yet, that may be another FAQ entry).

Anyway. Don't worry about the above, but if you get to have
some spare time, perhaps you could consider one or the other
of the above, especially FAQ entries, which I think may be
easier to just write down, compared to code. :D (I am currently
updating an old ruby-gtk3 app and it's a bit tedious ...)

With a specification I also kind of mean not only testing
that specification but for other projects implementing it.
Like Rack, where we can have generic wrappers that can be
used. A button {} stays a button after all!

Thanks for reading.

Battleships - a few not-so-important comments/suggestions, please feel free to ignore/close at any moment in time

Hey there Andy,

I recently watched some of the Battleships video at: https://youtu.be/b00OWeLZOt8

(I did not watch it completely - you know, my attention span of a squirrel and multitasking
where I manage to confuse myself. Right now I have about 40 tabs open in firefox, the
last ~10 or so quickly fluctuate - I use that a bit like semi-bookmarks).

Anyway. If I understand it correctly hen battleships currently work for SWT, which is
kind of the "main" entry point into glimmer (at the least as far as I understand it,
since you probably put most effort into SWT, e. g. the editor and so forth).

So my first request would be:

(1) If you ever have some time, would it be possible to also port the Battleship
to different toolkits, based on glimmer? I am not sure how easily feasible
this is, but it would be interesting to see how it works.

(2) Perhaps if you use a central glimmer (bin/glimmer) entry point, perhaps
you could consider adding a game-related section?

Something like this, assuming the below example uses bin/glimmer:

glimmer --game=tetris
glimmer --game=battleship

And so forth.

Or if more information is necessary, something like:

glimmer --game=tetris-libui
glimmer --game=battleship-tk

Or some variant like that. Ideally if it is not available then
it could download this. This is mostly for convenience.
The syntax can be different of course, you could omit
--game= and what not, I just wanted to demonstrate what
I mean.

On error message when it is not implemented, glimmer
could show something like:

"tetris for gtk is currently unavailable"

And so forth.

(This could be enabled for ALL glimmer apps, kind of like
the "glimmer store" example, but I am focusing primarily
on what you wrote. I think it is easier to adapt something
towards code that works, as opposed to implementing
something from scratch, which can take a lot of time. I
guess the first time you add a game it is more work than
later tweaks.)

(2) Statistics via a webpage

I think I mentioned this in the past. I saw on some of the
videos the entries in regards to available games, from
within glimmer. That is all fine, but new users may not
yet try out glimmer by installation, so I think some overview
may be nice to have. I guess glimmer here serves a bit
like a generic entry point to all of glimmer, but perhaps
you could add some statistical information about the
whole glimmer suite too. Things people may find
interesting e. g. "supported games: 20, 8 supported in
glimmer-tk, 4 supported in glimmer-libui" and so forth.
Perhaps an external website but otherwise github should
be fine. And perhaps automatically generated so you don't
have to do so manually. Kind of something to show new
users. The current README has a lot of information,
which is great, but perhaps something that is easier to
read and digest. A bit like zenspider's old quickref, but for
glimmer. Kind of like "this is the page to get a short but
useful overview of glimmer, including links" or something.
And statistics too! I like statistics, as overview helper.

(3) Perhaps add "Battleships" to the glimmer main README,
could be a simple short sentence and one image to keep it
small. Right now we have "glimmer tetris", so it would be
interesting to see different games. At the least for swt perhaps.

You currently mention it (aka the string "battleship") in the changelog
but not in the main README. I think a general entry point for
swt and perhaps glimmer itself may be nice. And if you can
add support perhaps in tk or something. Or even libui. The
latter may be interesting if only for users on windows - libui
on windows is really a good idea. I wonder if we could
implement zenity, but I may file a separate issue for that.

(4) Icons!

We want battleship icons. :-)

I don't know how easy it is to get permissive images here.
I think you used some central icon site that allowed you to
use some icons for another project (i forgot it ... was it that
cyberpunk game? Or something like that. There was some
website I remember where you could download and use
icons/images. Perhaps something like this exists too. A
boat. A larger boat. :D)

(5) Sound effects (optional)

Could be interest to add two small audio sites, but only if
they are available locally, e. g. no need to bundle it. If
a ship was hit, make a different sound that upon a miss.
Users can enable/disable sound settings (not everyone
wants them, but it would be nice to support that - it's
just a fancy/candy idea, not really important for the
actual gameplay; but it can also give people ideas if
they want to implement their own games. Perhaps
even in glimmer, at the least for simple games).

Anyway. I think I'll end this here. As always please ignore
when things take too much effort.

Glimmer videos in general - a suggestion about them in the long run

Heya Andy,

I see you are working on adding more videos to the glimmer suite; actually on SWT, such as your recent "Glimmer DSL for SWT Video Tutorial 6". I assume you will probably add more videos like that in the coming months.

I had an idea about that, or related to that. Let me describe the use case.

Say that someone has been using ruby for a few months and now is looking for GUI-related options in general (in ruby), be it desktop-centric, web-centric, TUI-centric (ruby ncurses or something like that), commandline-centric - you name it.

So, after searching for a while that person finds glimmer. The videos that you have made available are to some extent a bit more centric to the SWT part I assume (you seem to have more advanced parts in SWT, such as the editor), but probably many things may work across the whole glimmer suite, for instance, ruby-tk and so forth. A button is a button after all.

What if there would be a "general intro" or "general promotional" video for glimmer? Kind of something where you can showcase some things that can be done via glimmer, but specifically that what could work across all or most GUIs. Kind of like a "common base" for the glimmer suite, specifically with the aim as a general introduction or general promotional video. An introduction to glimmer.

Something you can quickly show to someone else as an introduction. It should not be too short, but it should not be too long either. I don't know how long it should be, but I'd say below 3 minutes may be a bit too short-ish; people may pay more attention if it is a bit longer than 3 minutes I would venture a guess. But it should not be overlong either because staying focused is not so simple for everyone (my own attention span drops quite quickly after some time, so I often have to pause; I often run videos from youtube in the background, so I don't always pay attention to what is going on there).

The general use case for that "glimmer-video" would be about showcasing how things could work across the glimmer suite.

For instance, something where the demo can also show how things work in ruby-gtk, or opal/rails. Mostly just the basic stuff. Or perhaps if you want to, show some of the generic shapes, how this may look. Obviously you can not demonstrate everything in one video, but this is not so much the point anyway; just something that can show to people what glimmer is all about. And you could always finish with some more examples that are more advanced, such as tetris or whatever.

One important thing could be to show how people could easily adjust the code base. So for instance, just as in video #6 it is shown this require:

require 'glimmer-dsl-swt'

You could show the same example (if it works) for, instance, the tk variant for glimmer. And perhaps the opal/rails variant. (Again, I am just thinking of the basic stuff, such as button, or a box/div/container, not anything that is too complex).

The idea here would be that people could adjust the code or the toolkit in use very easily, and have that be mentioned in the video.

Anyway, I think I should end here as it is already quite long. Hopefully I could explain the basic gist of the idea. I am not saying this should be done now either, mind you! More like a long term goal, a "general intro video". The KDE folks even use music in their own "what is new in KDE plasma", but I am not sure music should be used for glimmer as such. While music is nice, often explanations are more useful. So the idea is more about a general intro that is useful though, like giving a newcomer ideas what is possible. (They can work through the README and the examples there, but some people may prefer video, so - different target audience perhaps.)

Perhaps after you made some more SWT-specific videos, the next one could be a bit more generic (I know the SWT ones are also kind of generic, as I assume the code will work at the least for some parts, such as "a button", but I mean more in the sense of looking at the whole glimmer suite as such; people are probably not fully aware of how they can use glimmer IF they didn't know glimmer yet, e. g. newcomers to glimmer specifically.).

Glimmer on! \o/

[Idea, just as impetus, don't worry about implementing it and feel free to close it at any moment in time] "Automatic glimmer" or "Automated glimmer" - automatically generating a GUI for commandline applications

Hey there Andy,

I am currently re-writing one of my largest gem, the one I use to compile everything from source. I use
that on linux, but I want to be able to compile on windows too via msys2 and/or cl.exe or whatever the
name of the commandline binary was from Visual Studio.

In the process I am also building a GUI in libui - right now I go the hackish approach and have not
yet added glimmer-dsl-libui. (That's kind of one reason why I would like to "combine" the DSL of
glimmer via "traditional" OOP. My hope is that I can offer both variants, the glimmer-libui variant
for more feature "goodies" and what not eventually, but in a non-exclusive manner.)

As I am writing both commandline and GUI right now, I wondered why I am actually writing or
specifying the GUI. What if the information contained via the commandline class that I use
here could be used as basis for an AUTOMATICALLY generated GUI, in glimmer? Or
glimmer-libui for that matter.

So for instance, let's take rubio radio. Say we have the:

--backend [vlc/mpv/mplayer/mpg123] # or something like that.

Ok. So ... this could be translated automatically into a combo-box, and the default
is inferred by glimmer correctly (in this case vlc).

We could apply this for ALL commandline options IF they make sense and if they
can be exposed via a GUI. I guess this is the hard part - to have glimmer try to
figure out which parts of the commandline are GUI-like. But this could be specified
in the commandline perhaps, aka attach meta-data that does not hurt if it is
specified, but could be used for an automatic glimmer GUI.

Anyway, this is just another loose, semi-random idea. While this may not be
as good as a human being fine-tuning a GUI, it could be of benefit for
those users who write predominantly linux scripts, but would like to have
a simple GUI, without wanting to write a GUI for all these .rb files. Kind
of like "write commandline, get a GUI for free" as a motto and slogan
for glimmer. I am great at coining slogans! :D

Problems scaffolding

Hi, I started exploring glimmer but had problems scaffolding:

I'm working on MacOS 10.15.6

jgem list glimmer*
*** LOCAL GEMS ***
git-glimmer (1.7.0)
glimmer (0.10.2)
glimmer-dsl-swt (0.6.2)

rbenv versions
...
* jruby-9.2.13.0
...

The glimmer command launch correctly a basic hello_world app BUT trying scaffolding I have always the same error message:

glimmer scaffold[mytest]
Namespace is required! Usage: glimmer scaffold:custom_shell_gem[custom_shell_name,namespace]
glimmer scaffold[mytest,myself]
Namespace is required! Usage: glimmer scaffold:custom_shell_gem[custom_shell_name,namespace]
glimmer scaffold:custom_shell_gem[mytest,myself]
Namespace is required! Usage: glimmer scaffold:custom_shell_gem[custom_shell_name,namespace]

I also noted that in this article http://andymaleh.blogspot.com/2020/08/writing-glimmer-timer-sample-app-in.html the scaffolding command is different from these written in the instructions https://github.com/AndyObtiva/glimmer#advanced-usage, and also that the output of the glimmer command is different, I have:

glimmer
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)

(See full trace by running task with --trace)
Usage: glimmer [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]

Runs Glimmer applications/tasks.

Either a single task or one or more applications may be specified.

When a task is specified, it runs via rake. Some tasks take arguments in square brackets.

Available tasks are below (you may also lookup by adding `require 'glimmer/rake_task'` in Rakefile and running rake -T):


When applications are specified, they are run using JRuby, 
automatically preloading the glimmer Ruby gem and SWT jar dependency.

Optionally, extra Glimmer options, JRuby options and environment variables may be passed in.

Glimmer options:
- "--quiet"           : Does not announce file path of Glimmer application being launched
- "--debug"           : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
- "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)

Example: glimmer samples/hello_world.rb

This runs the Glimmer application samples/hello_world.rb

It seems how there aren't any tasks available.

What I'm doing wrong? I missed something?

NixOS package

Desktop (please complete the following information and make sure it matches Glimmer Pre-Requisites before reporting an issue):

  • OS [e.g. Linux Ubuntu 20.04.1 LTS]: NixOS
  • Java Version [e.g. 1.8.0_241]: Can be defined
  • JRuby Version [e.g. jruby-9.2.13.0]: Can be defined
  • Glimmer Libraries/Versions [e.g. glimmer 1.0.1 / glimmer-dsl-swt 4.17.2.4]: Can be defined

Describe the issue
NixOS is a reproduceable build system designed to have multiple versions of a program installed simultaneously without using containers or virtualization software.

I would like to request a glimmer package for NixOS. I have already submitted a package request to the nixpkgs repo here: NixOS/nixpkgs#293795

[Idea / Discussion] Glimmer up EVERYTHING! \o/

Hello Andy,

I listened to ~40% or so of the latest podcast.

Anyway.

Glimmer is sort of a DSL. Over the months or perhaps years you did add quite some apps (I include games into
that, snake, tetris, not sure if I forgot any) and more recently contact_manager (would be nice if these could work on the www/opal, tk, gtk, libui but anyway, this issue here is more a semi-loose idea or discussion and less about committing others to write code :D).

If one is to look at the www we have various "app builders". For instance, we have webmin for doing admin
stuff via the browser interface. We have the SUSE control panel which I think is in ruby. We have things such
as KDE plasmoids or whatever the name was. We have conky widgets for fancy display of things. We have
operating systems that try new things such as serenityOS or menuet-OS. In general I think mankind builds
User Interface elements. We can kind of include the terminal interface too, to some extent, e. g. ncurses and
similar.

So here is a crazy idea: what if we glimmer up EVERY application that is out there? Like everyone builds
glimmer GUIs or glimmer-like GUIs? Kind of when you write an application once, and it works on all
operating systems, it works via tk, gtk, libui, www/opal/rails (SDL). Note: I am NOT saying you should do
that, mind you. I am more thinking of like having a huge repository where people could contribute
things and applications, in glimmer (or a glimmer-like DSL). Perhaps even build it against a glimmer
specification, and have different glimmer versions with backwards compatibility (to keep older
apps written via glimmer work, without needing to update these).

You may ask "what's the point", but I think one benefit of this may be that people could contribute their
GUIs. Like, we need tetris to be written only once, yes? Ideally very flexible and useful. But once it is
written, and it can be customized, then nobody has to write it anew. Just use the glimmer tetris!

Same with ALL other games and widgets. And apps. Write once, run forever.

Ideally there could be a gazillion of widgets people could then just use and re-use fine. Note: I am
not necessarily saying this refers to the CURRENT glimmer iteration. I think I mentioned in the
past a GUI-like editor or IDE where people could write glimmer-apps without necessarily needing
to use ruby or something. A bit like glade or so, from the idea. Kind of like glimmering up the whole
world with glimmer things.

The idea would be that the "cost" of writing these apps could be lowered; and the more people that
use it and contribute to a repository the better.

This does not even necessarily have to be confined solely to ruby. It could be like a meta-DSL that
is translated or compiled into other languages. But this could be at a later point.

What may be important here would be for people to be able to contribute to a unified repository.
Many people may write something but then disappear (it happens), so any road blocks should
be avoided. In other words to make contributing to glimmer or a glimmer suite (of applications)
should have a very low difficulty of initial entry to the "glimmer world".

When I write "glimmer up everything", I don't necessarily mean ALL the applications, but, say,
to showcase some examples (like the games you showcase) and work from there. Or the
contact manager example - I am sure many people may find that useful. And so on and so
forth. So, like to have some projects that people can just use. And perhaps like build up to
something like an operating system (ignoring the base components, but, for instance,
Microsoft typically has a calculator, calc.exe or something. With glimmer we could kind of
like offer this too, in principle, yes?).

I think you already link in to some other projects that use glimmer or so, but perhaps more
contributors could be "collected on the way" e. g. to ask them to add or showcase some
glimmer-specific apps and integrate them or link to these - kind of like a "glimmer world
repository" (better than everyone having it split in github repositories that may at a later
point be abandoned; I encountered that problem specifically with the gosu library,
where many people wrote games that still work, but abandoned their repository many
years ago already.)

Anyway. I am not sure if what I wrote makes any sense, but these are just some loose
semi-random thoughts. I was thinking mostly of a situation where you have, say,
1000 different people write 1000 different widgets, and commit these to a "unified
glimmer pool" where people could just re-use these - like with superkaramba or
conky scripts and what not. Or like the Microsoft store? So just the glimmer store
where people can contribute their code easily to.

[Idea, please close as desired] Glimte-Glimmer for Everyone \o/ (GUIs everywhere)

I am stalking you as you may know :)

And I found Glimte indirectly due to your fork.

https://github.com/Phaengris/Glimte

I also found nebula that way (did not know it exists prior to your changelog entry at github).

https://www.eclipse.org/nebula/

What if we'd have this (that is, both combined) for all of glimmer? Kind of like the desire/goal to be able to have as
many widgets as possible, but without necessarily the user having to write them for any specific toolkit? A bit like
LEGO building blocks. We assemble and re-use the blocks to create stuff. Larger stuff. We build complexity. From
small to big.

We could then write the logic once, and glimmer would do the rest for us. So people could then
use any GUI toolkit they'd like to, such as via a commandline flag to switch. And, ideally, if that
were possible, to also have rails/sinatra/javascript code for the www. Like, we write a game
in glimmer, like tic tac toe (just as a silly example) but we can use it on the www as well even
via a simple plain .html (perhaps opal can help there).

Or we could use and specify to use the nebula widgets for glimmer, if these work, for java
centric applications.

And, perhaps if it goes super-fancy, to use jruby, and even graalVM for natively compiled
static GUI applications. Not sure if that is easily possible but that would be kind of neat -
write once, run every GUI. :D

Perhaps not even in ruby only or java, but to bridge into C, C++ and other languages.

And not even requiring a user to know ruby, in order to use glimmer. Kind of like an
abstraction layer people could just use as a template or something like that. Where they
focus on content, then add a few checkboxes for the desired style, and glimmer does the
rest for them. A bit like the old Glade XML, but simpler to use.

Anyway. I have no idea if the above makes any sense to you at all. It's a bit semi-random
so apologies for that. I just think it would be interesting to see how far glimmer could
push the boundaries there. In some ways glimmer kind of rescued the old shoes from
_why too, in the sense of writing in a ruby-centric DSL and have it "just work".

[This is more an idea/discussion, less so a specific issue] Unified GUI-DSL for ad-hoc glimmer drop-in-support? Aka designing a class and then simply add glimmer support for different toolkits onto it

Hey there Andy,

This is more just a rough idea I had. Please feel free to disregard
or ignore if not applicable or for whatever the reason not considered
useful. It's really meant more as an idea as such.

Recently I had a few issues unrelated to glimmer or libui. For instance,
I did set up win10 again on my laptop, because it became, oddly enough,
super-slow suddenly (not sure why, the laptop was cheap so it behaves
quite oddly sometimes, e. g. overheating too).

Now that I set it up right now I had issues getting libui to work; I actually
got the same problem that you had a few months ago with just about the
same issue of ruby not finding fiddle. But anyway, that's not what the
issue here is about, I just wanted to explain the backstory a bit.

So ... now I am slowly setting up things on my laptop again. Right now
it is semi-stuck at "Working on updates 98%" since a few hours ... :P

(The updates issue on windows became soooo annoying ... they really
got so much worse than linux in the last ~15 years... but I digress)

Now, however had, libui does not work right now. I know that tcl/tk,
including ruby bindings, will work. I got them to work in the past as
well but I did not try yet again whether they will work ... waiting on
the updates to finish right now.

So I was thinking ... "what if I could add glimmer-dsl-tk support
as-is on classes"?

For instance:

class SomeGui

  include Glimmer::DSL::Tk # Don't mind the syntax not working, this is just the example

  def initialize
    run
  end

  def run
    button1 = button('Batch-install all my windows addons)
    button1.on_clicked {
      do_batch_install_all_my_windows_addons
    }
  end

  def do_batch_install_all_my_windows_addons
    # do all necessary stuff here to set up everything
  end

end

So, the idea is to designate which GUI to use (in this case tk but
we could easily switch this to, say, gtk or libui or whatever is
supported by glimmer). But retain the very same code base
"internally". So we would kind of have this work for any
toolkit or WWW or whatever glimmer as such supports.

The benefit of this would be that we could have the same unified
code base and just "plug in" different GUIs.

I don't know whether this is currently possible in glimmer yet or
not. If it is then just disregard please. The primary idea here,
though, is to have a kind of unified approach to DSLs in this
regard. The specific API in the DSL can vary, that's not so much
my concern. The focus I have here is more on having SOME kind
of DSL/API that could work easily (at the least the basic stuff,
such as a button. A button should be a button everywhere. That
different toolkits have some unique peculiarities is a separate
issue that I am not so much concerned with for the BASIC idea
here, if you understand what I mean).

The above example uses include, but we can probably make this
even more flexible if we do not have to use any subclassing
or include at all, and simply designate which toolkit to
use in another way, such as a toplevel @variable that keeps
track of the toolkit in use or some other way.

In my own (semi-failed or semi-abandoned) attempt to use a
unified code base I went via "use :gtk" or "use :libui" and allowed
the user to simply change this from the commandline, such as
via --use-gtk or --use-libui. But it's not so important what variant
is used specifically, just that the idea behind this should work.
The API and DSL in use is more a specific design issue; the
underlying idea is more important. A bit like how rack serves
as base for most ruby webframeworks these days.

Anyway. That's it so far with my idea. I may have forgotten
tons of things or perhaps this all works fine already, not
sure. I am just having this idea as I keep on waiting for the
windows update to finish, so I have some spare time ... :P

Glimmer statistics (aka overview)?

I am trying to improve on opal lately so I stumbled (again I think) over https://github.com/AndyObtiva/glimmer-dsl-opal.

You write it is about 76% complete. You also bring in many examples.

It can be a bit confusing to know which examples / samples work on which glimmer variant. So I was thinking ...
what if we could have full glimmer statistics? That is, to automatically assess which particular subprojects reached
this or that milestone? Say, the glimmer wxruby bindings may be less complete than the SWT parts.

For instance, this could help users answer this question: "does tetris work on glimmer-opal", and so forth.

Not sure if you get what I mean here. Ideally something that you could run programmatically and which then
generates some table or something, for embedding into .md, and/or an image as a quick overview (text is
probably simpler though).

Anyway, as always feel free to proceed in any way shape or form. My use case was specifically to see (and
try) using glimmer + opal to learn from it, ideally via examples that are simple but still useful (these should
make it easier to learn; more complex projects can be a bit daunting).

[Idea/Suggestion - please feel free to ignore/close at any moment in time] Glimmer for the terminal?

Heya Andy,

Recently there was a question on the ruby reddit site:

https://old.reddit.com/r/ruby/comments/vylge0/what_library_can_i_use_to_create_a_tui/

The shortish question asked by the threadstarter was:

"[What library can I use to create a TUI"

Some links given were:

https://ttytoolkit.org/
https://github.com/Shopify/cli-ui

The shopify UI is quite interesting, you can select the entries and have them
appear in different colours.

Here is that example: https://user-images.githubusercontent.com/3074765/33797984-0ebb5e64-dcdf-11e7-9e7e-7204f279cece.gif

Anyway. I am not suggesting you use ncurses - I myself hate the ncurses API so I don't recommend to people use it when I dislike it. :P But some projects created with it are quite nice. For instance, the linux distribution GoboLinux had AbsTK (abstract toolkit) and it combined a terminal interface as well as a GUI, for installing gobolinux).

So my idea - and it is really just an idea, don't worry about investing time here - is ...

What if we can do "write once, run eveywhere" via glimmer? That is we write glimmer
libui application but it could also work on the commandline as-is. May be hard, and we
have to abstract a way lot of things, but could be doable.

Or, perhaps that may be more logical, to START with a commandline basis, for quick
stuff prototyping; and at a later point when a library works well and the user wants to
give it to other people too, to use it, a better GUI is done from that commandline
base. So we can start with the commandline, and at a later time "upgrade" it to a
full GUI. E. g. from TUI to GUI or something like that.

Anyway, this is really just meant as an idea. I think you played around with some terminal
user interface, but most work you do in regards to glimmer probably goes into SWT and
libui and ruby-tk and so forth I think. Would be kind of intereresting to have games such
as snake or tetris or tic-tac-toe all work on every glimmer "platform", including the commandline.

Glimmer FAQ? (Low priority)

Hello Andy,

First, let me preface that glimmer rocks, and the documentation + screenshots you provide are really great.

I have been quickly able to use glimmer-dsl-libui. (I encountered an indirect issue, but this was not related
to glimmer-dsl-libui; I think resizing is somehow slow-ish? Not sure if this is due to my own custom code or
anything else. May be just my impression but libui widgets in the main examples/ provided by kojix2 seem
to be slower than before, but again, there is a high chance I am wrong. I did not test it consistently. Originally
I thought the images were too large, but I noticed this resizing "problem" with kojix2' recent release too,
so I wonder whether something is messed up on my system. I don't recall resizing to be slowish, so it's
confusing me. I wish I would have documented this some months ago, so that I could remember whether
resizing used to be slow in the past ... perhaps I should test it with the earliest libui releases, but this is
a side point, not related to the issue here or necessarily with glimmer or glimmer-dsl-libui.)

Many standalone examples exist - I copy/pasted and then adjusted from that. :D

However had, I also have been wondering whether a FAQ may be useful for the whole glimmer dsl suite.

I don't know how easy it is to do the "write once, work everywhere" philosophy. Would be kind of neat
if we could transition between ruby-gtk, ruby-libui, ruby-tk, ruby-opal (or whatever the name was, I forgot
it right now).

So may a FAQ be useful? I don't mean a FAQ in the sense of Andy maintaining it only. It could be just
a wiki and we can work from there perhaps.

I also don't mean a FAQ to include ALL details, mind you. The main documentation is already useful for
this. But things that may be useful to know, hints, tricks, tipps ... a bit like how StackOverflow works. And
kind of have this as part of glimmer as-is.

I give you an example. Say that a newcomer asks:

"I want a button that pops up a Hello world! widget in glimmer. I would like to see how this works
in the simplest, shortest way for all across glimmer e. g. tk, libui and so forth."

(This is not an ideal example because there are already screenshots covering this, but I am thinking
along those lines, e. g common tasks that users may want to have, and just keep a short-ish FAQ
without too many explanations. The examples as-is that you provide are already quite detailed
and info-rich, so I am not asking to duplicate that effort. Just something that can be quickly
scanned by newcomers to find interesting things and so.)

Perhaps the github wiki can serve as starting point for that, but I have to admit that I don't like
the github wiki that much - I know from GoboLinux that the wiki there tends to die quite quickly.
But anyway, this is mostly details; the bigger issue or question is whether some kind of FAQ
or FAQ-like entry point (similar to StackOverflow) may be useful for glimmer as a whole in the
long run. Perhaps if there are only few users it's not so relevant, but in the event more people
transition to glimmer then this may be useful. Please feel free to close / disregard. It's mostly
more a sort of question or suggestions; how useful this may be I don't know myself either.
The examples and screenshots already cover a lot, so people only have to read through them,
which is fine. I am more like thinking of a FAQ as some kind of additional quick-overview
pointer, a bit like zenspider's quickref to ruby (see here: https://www.zenspider.com/ruby/quickref.html
to kind of contain what is useful for many to see quickly, without drowning in details)

[Suggestion, low priority] Provide "statistics" and information about the whole glimmer suite in some way, or perhaps several ways

Hey there Andy,

Before I describe this issue report/request, let me explain how I came to it.

In one of your recent videos, I think it was "Parking", I saw one of the drop down
listings mention several games (or widgets) on the left hand side. I actually was
surprised to see that many widgets, so I am not quite up-to-date. :)

I assume it was for glimmer SWT primarily so I guess it may not work equally
well across all bindings; or at the least I think SWT is where you put in a LOT
of your time. A while ago I suggested kind of something like a "store" where
users could "discover the glimmer world". E. g. a bit like the Microsoft store
or any other store; my idea was less about monetization per se (although
this could be a side goal), but more about "discoverability" - e. g. if a user
wants to know if this or that exists. Perhaps even via search functionality

  • tags, if at one point you have a tons of different ready-made widgets
    already. But actually, while I think a store-like app may be nice, ultimately I
    think the more important part is to find what a user may want to find here
    (in this case, me - so my suggestions are also mostly for selfish reasons
    too :D ).

Would it be possible to perhaps have some kind of "cheat sheet"? Like if
you remember zenspider, the quickref he maintains: https://www.zenspider.com/ruby/quickref.html

Something similar to glimmer. Perhaps a table layout or something.

Something that is condensed, though, like for instance:

"Available Games:
game1
game2
game3"

And so forth. And then to display the status among different glimmer suites,
e. g. "supported in SWT, TK" and so forth and a marked checkbox. Or
some other way.

You already provide a LOT of information which is nice, but perhaps there
could be a central "overview" site too (and people able to find it; sometimes
you may not find what you are looking for).

This page could also show some statistics if you would like to. But this
is secondary; my primary rationale for this request is that people can
quickly determine what works where. If the glimmer suite were a webpage
like rubygems.org, then a sub-API such as /stats or /statistics or
/overview or something like that may be nice.

If such a detailed overview already exists then perhaps it could be
mentioned more prominently. Right now I am not sure on which
toolkits the games or customized widgets, including Parking, would
work. Would be neat if we can obtain that information quickly, ideally
via a webpage. This could also help users before they download other
applications, such as windows users before they download jruby and
play with it (or SWT perhaps).

Anyway, this is just a suggestion, please feel free to proceed as
always - my aim is not to draw away too much from your time. Providing
information is super-important, but sometimes it seems hard at the
least to me to be able to answer simple questions such as how
strong the support is on some of the toollkits and what widgets may
be available.

Glimmer gosu support? (This is more a question though)

This is more a short question, sorry for that.

Do you think glimmer may support gosu one day? And could this then also work
on windows?

Gosu does not have a lot of support for custom widgets, naturally, since it caters
more towards games. But I wondered since you can create nice games in gosu,
so useful widgets could also be supported. But it probably would require quite a
lot of time and your time is limited, so don't worry too much about that question.
I am more interested in how feasible it may be. "Write once, glimmer-run everywhere"
slogan. (Actually my primary use case for windows comes from elderly relatives
who depend on Windows.)

[Question / Brainstorming subsection] Long term goals for glimmer "as a whole"?

Hey there Andy and everyone else,

This is a bit of a meta-question or meta-suggestion. It's a bit wild in format as usual
when it comes to my issues.

Before I explain the issue here (actually more a question than an issue), allow me to preface it a bit
and explain the context surrounding how I got the urge to ask that question.

I have been following glimmer for some time now; I forgot when I first noticed it but
I don't think I even knew about it ~2 years ago. Hard to remember without me
checking all my browsing activity (which I am too lazy to do) but I am pretty certain
to not have known glimmer ~2 years ago or so.

Glimmer itself is semi-young, I think, if we look at rubygems.org:

https://rubygems.org/gems/glimmer/versions

At the least the entries from 2017 I assume came from Andy. Not sure what happened
between 2009 to 2011 but perhaps the project is older but was dormant? Either way I
think we can say that glimmer started to "get traction" more recently. I also see Andy's
message elsewhere, e. g. the cyberpunk GUI thing and so. I assume Andy invests / invested
more time into glimmer in the last ~2 years or so, but again, I am just assuming here.

Recently glimmer-dsl-gtk support was added. glimmer-libui is a bit older now, a few months
I guess. glimmer-tk is much older, glimmer-java (whatever the name was) too, and the
javascript stuff.

In many ways glimmer is a bit similar to the idea I once had about a unified widget base,
like you just use a DSL to describe all different GUIs. Back then I was thinking mostly about
gtk, qt, tk, fox/fxruby ... but we can include the world wide web. And the latter part got
me thinking a bit...

What if we could use glimmer a bit like rack, as a base for other projects, BUT also as an
abstract toolkit for rails-based projects? Perhaps even have direct support for javascript
as-is via opal.

What I mean with this is ... if we think about rails, we work with widgets too, sort of - all
the HTML5/CSS things, and the dynamic parts via javascript or some javascript-framework.
Wouldn't it be cool to actually describe this just once, e. g. in the glimmer DSL but have
it work "internally"? I am not necessarily saying to be able to do what ALL of rails can
do, but more like ... a bootstrap stage for minimal rails-like things. Like a web shop!

We could then describe a webshop once, but have it "run everywhere". Actually I was
even thinking of converting ruby-gtk3 code to the corresponding C code or at the least
as much as possible, so I can compile it for more speed. :D

Alright. This is the intro for this issue request kind of ...

My question thus can be summarized as:

  • What are future goals for glimmer (say in the next ~2 years)?

Now, Andy provides some ideas and things on a todo list, such as
https://github.com/AndyObtiva/glimmer#feature-suggestions and
elsewhere, but I mean more like "grand visions". Like what's coming
next for glimmer as a "platform"?

I think this may not only be interesting to me but to other newcomers too,
in particular when a project becomes more widely distributed (see upstream
libui struggling here a bit because others are reluctant to want to take
over :D ); things that may come to glimmer eventually. Or perhaps even
ideas that currently are too much work or can not be done otherwise due
to time constraints.

Andy writes a LOT of content which is good, but specifically I'd love to hear
good ideas too (I admit to stealing a few good ideas every now and then,
but by and large my own laziness is my own biggest obstacle so I just
want to read up on great ideas coming about, if that makes any sense).

As always please feel free to ignore/disregard or close, but perhaps in
the event that you work on glimmer in the future as well as the documentation,
perhaps you could think about this part too, whether it may make sense
to add a section to the README in this regard or not; obviously goals may
change, but that's ok, even if outdated - I like to look at my older projects
to see what grand ideas I had when I was younger; most of these never
got implemented but a very few did! :P )

Glimmer support for jruby + SWING?

Hey there Andy,

Sorry if that was suggested before.

You already support tons of toolkits, SWT, libui and so forth.

Does glimmer support jruby + SWING? The reason I am asking is because
if not then this could be a low-hanging fruit, since swing, even though it
may be outdated, is quite usable. I tested it on windows too, e. g.
jruby .exe, and it works. So perhaps that could be an additional use case
for glimmer, unless there is some reason why jruby + swing may not be
supported. Either way I just wanted to briefly mentioned it. Please feel
free to close this as you deem it fit.

[Request / Idea] [Idea for a somewhat succint glimmer-related video] How to install and set up different glimmer projects

Hey there Andy,

I see you have been busy with glimmer-swt now being at part 12 of the video
tutorial series.

I have a semi-"loose"-ish idea: in the event that you may have some spare
time in the future, how about a general video that just shows how to
install and set up different glimmer suites? For instance glimmer-opal,
glimmer-libui and so forth. And to showcase the example for a simple
"hello world" in each of these.

This should not take too long per glimmer variant, so perhaps between
30 seconds and 180 seconds at max, or something like that.

Rationale: You provide adequate documentation, but sometimes it may be
easier to look at a step-by-step video. For instance, being selfish :D
I'd love to watch a glimmer opal video from start to finish (it's ok
to install rails too here). That way I can see where I made a mistake
(I am failing hard installing opal ...).

Perhaps other users may have similar struggles or so. In each case
having a video may be helpful. If it is too much work though then
please just skip this - this is just an idea. Time is a finite
resource.

(Which operating system is used is not so important I think; it's
fine to show this how it is done on OSX only. And if it is the
same procedure then it can probably be skipped, e. g.
glimmer-tk and glimmer-gtk may be quite similar to it may
not be worth to do so for both when one suffices. So perhaps
this can be grouped into web-related, desktop-related and
java-related, or something like that. So 3 videos or so. opal
would then be included in the web-related part or so)

Anyway - thank you for reading!

glimmer-meta-overview: Offer some (multiple?) way(s) to check on glimmer progress overall

Hey there Andy,

You offer tons of different things related to glimmer, either directly or semi-indirectly (e. g. support code
that could also be used outside of glimmer, I would classify as "semi-indirect").

You also offer support for glimmer-gtk and glimmer-swing. I assume these are not as high priority as,
say, glimmer for the web, and glimmer libui.

You also provide some GUIs such as tetris and various more, which I think is important for end users,
in that they can select from a multitude of different things there. For instance, I am thinking of re-using
the games part in my own GUI things, because ... it's kind of pointless to re-create the work you did
when tetris, for instance, already works. So in my own ruby-gtk stuff I could just re-use that, and
somehow embed it (if I find out how that can be done).

I don't check daily on glimmer, but I do check on glimmer every now and then, but mostly via an
overview e. g. "Aha, Andy worked on glimmer-web-related things recently". Or before that, on
glimmer-libui.

Naturally different toolkits offer different features and I think you support some of them more than
others via glimmer. For instance, I assume you probably have more code for SWT and libui, than
for, say, java-swing and glimmer-gtk.

This brings me to the issue request here; I think I may have suggested this in the past, so please
assume best intentions here when I wrote this issue request.

I would like to have some kind of "overview at a quick glance", ideally, like "this and that works on
this toolkit; that and this works on that other toolkit". Kind of like a general progress report.

Now we can do so indirectly e. g. the amount of documentation you make available. Like, more
via glimmer libui and glimmer web than on glimmer gtk. But I would ideally like to see this:

(1) A way to somehow have a table, ideally in markdown format, that you can programmatically
or automatically update (to reduce manual work); and this table should show a good overview
of different things working in this toolkit, but not in another toolkit. For instance, as a simple
example:

button: works in toolkit A, B, C; does not work in toolkit C

Ideally a table, and some kind of cross-mark (but it can also be words, e. g. Yes/No).

The idea is that we, as visitors or developers, can quickly see what works where and how.

And, to somehow NOT require of you to have to manually update this. Not sure how to
best solve that; for static websites I generate I usually do this via some macro, and
whenever ruby finds such a macro it replaces it with the appropriate code, e. g. "this
gem supports 153 programs", and the number part is then returned by some method
or class that solves this problem.

(2) Show which applications are available on which toolkit. To give the example of tetris,
show which toolkit support it e. g.

games (<--- as a theme):

tetris: works on glimmer, glimmer-web; does not work on glimmer-gtk

and so forth.

So how to solve this?

Well, perhaps the repository here could be the "glimmer meta-tracker", in that it gives
an overview over ALL the other glimmer things. I think you already do so to some
extent; at the least I can see you provide a table where you explain and show the
different toolkits. So I am not suggesting to change this, but perhaps an additional
table can be used to "meta-track" progress on different toolkits there.

An additional nice thing would be if glimmer itself, via the commandline at the
least, could display this in an easy manner such as:

glimmer --statistics # or whatever else you deem appropriate, such as --overview

The idea here is that this shows in a terse table-like format what works and what does
not work here. If this becomes too messy to show then perhaps it can be grouped,
just as the example I showed about for genres, such as "games", or some other
grouping. Not sure how to group most applications, but I think you understand
what I mean via "genres" there - with games being one genre. Perhaps multimedia
is another one, or generic applications and so forth, you get the idea.

Anyway, the above are just examples, so feel free to re-evaluate and interprete them
how this is appropriate for the glimmer suite. The TL;DR part is that I would like to
have some kind of simple overview, ideally both on the web but also on the
commandline for output (and "glimmer --help" can perhaps briefly mention it), to
kind of know where we are here in glimmerland. For instance, just as an example,
feel free to evaluate the --flags I show accordingly:

glimmer --games
glimmer --games? # I like the trailing '?' so this means "glimmer, show me which games are available"

game a: works on A, B, C; not on D, E, F # could use the unicode checkbox here, or omitting it, as a table-like overview on the commandline

game b: works on A; does not work on D E F

(If this becomes too unwieldy and long, perhaps just focus on 5 or 6 toolkits or so, and then
a disclaimer on the bottom that more toolkits may be supported but these are the most well
supported via glimmer.)

Anyway thank you for reading - please proceed with this issue in any way as you deem fit;
and I would also agree that this is a low priority issue. Just something that would be "nice
to have".

(With percentage I would mean something like a rough estimate, say "glimmer web has
100% support, glimmer gtk has 40% support of the specification and widgets implemented
by glimmer-web", for instance. Just something as a rough estimate that can somehow
give an indicator of the progress.)

Glimmer "store"?

Hey Andy,

Just another semi-suggestion or so - perhaps it may not make as much sense right now
but who knows, in some months.

I was recently looking at some games again (can't take the games away from me!).

I noticed Glimmer Klondike Solitaire on SWT/jruby, I suppose.

However had, I was thinking that this could be done in ruby-gtk, ruby-tk, perhaps even
ruby-libui? I am not sure. Perhaps via the drawing area and if we can respond to mouse
on drag events (or even without that, buttons could perhaps substitute for this).

But then I was wondering ... do we actually have some kind of "central database" to
look up what is supported and where? So kind of like a "glimmer store", like the
Microsoft app store. I don't actually really suggest a website as such, per se, could
all be handled via some glimmer-app locally. But kind of like some listing to see
which games are available and which other apps are available. Like some search
entry, and people then also get a simple "is supported on xyz". I guess the SWT
glimmer apps are the most advanced since you seem to use these for many
projects, such as your editor. And obviously time is a limited resource so you can't
invest as much time into every project equally, I understand that.

The idea could be kind of that people could "build up on the glimmer world", like
a bit how Minecraft allows people to build stuff in the Minecraft universe. :D

Or perhaps if "store" is the wrong name then a "glimmer add-on server".

You can say that this may be a chicken-egg problem (more users equate
more applications) but I just think the idea of being able to have some kind
of store or add-on server may be nice. And perhaps being lazy too, like
just install solitaire. (And be able to answer the question whether it works
on the www too, without having to ask you, or search through different
websites. You provide a LOT of documentation in general, but some of it
is spread onto different websites and it may not always be easy to track
all that disparate documentation.)

Anyway - that is just a loose idea, don't worry too much about it and please
feel free to close it at any moment in time as you see fit.

[Idea] A simplified DSL variant for "common people"

Hey there Andy,

This is more an idea, so please feel free to close it.

I was about to suggest a larger "issue" for the whole glimmer suite/DSL,
but I think it is better to perhaps split up my ideas, and just isolate one
component. So that explains why I opened this "issue", more an idea,
for just one thing really.

Glimmer aims to use an expressive DSL. For instance, to re-use your
examples from glimmer-dsl-gtk, a rectangle or an arc can be defined
like:

rectangle(0, 0, 256, 256) {
 # more stuff here
}

# radial pattern
arc(128.0, 128.0, 76.8, 0, 2 * Math::PI) {
 # more code there
}

This is ok, but I was wondering ... what if we could use a "pseudo"-DSL
that normal people could use? Something like a DSL on top of the
glimmer-DSL. A meta-meta-glimmer. :D

I don't have an example of how I would envision that (coming up with
good, simple syntax is hard), but something that even elderly people could
use easily, and perhaps even not just text only (though a simplified text-DSL
would be nice), but something like ... glade for gtk using XML.

Now, I am NOT suggesting to use XML as such, but here I refer more to
the GUI-building part that people can use via glade. Something like a
meta-builder for glimmer. In glimmer. :D

I kind of imagine that as a big win if elderly people could re-assemble
the "desktop" or application they'd want to have. (I refer to elderly
people who may not be in perfect health, but are still able to
learn. With dementia it is a bit harder, so I more refer to people who
may not have been programmers, but are mentally still in a good
state - something to simplify making GUIs.)

Anyway, this is part of a larger idea I had - something like a unified "pipe"
system with object-orientation in mind, but based on widget-usage. Where
you kind of model your applications around different widgets that could
be re-used. And different people could write them, and then just "plug
in new functionality", like an ecosystem of widgets. I dream of a world
with unrestricted wigets! :D

It's a bit hard to describe, and I don't want to distract from the singular
idea here (a simplified DSL, or a meta-builder GUI for creating glimmer
applications, in glimmer), but a bit what the ring programming language
aims to do: https://ring-lang.github.io/

And perhaps also your other project, e. g. that editor you have
https://github.com/AndyObtiva/glimmer-dsl-swt or the table that a
user can modify. My idea is mostly based on the "how should a
GUI toolset look if it tries to target average people in general"
(so not just the elderly; common people who may not be
programmers, if you understand what I mean).

Anyway, I end this here - perhaps I will file a longer meta-meta-meta
issue for the glimmer DSL, but I feel that it already deducts from your
time so ... I am not going to create too many issues. Or trying not to. :D

Not glimmer-related, but a tiny display-related issue at http://andymaleh.blogspot.com/

Hey Andy,

Sorry for misusing the github issue tracker for glimmer, but I thought it is better to
report an issue than send an email. :D

I read the blog every now and then to keep up to date with things that changed. \o/

There is, however had, a small visual annoyance at http://andymaleh.blogspot.com/
in my opinion: the background image makes it hard to read the text as-is. Not
necessarily everywhere, but in particular when the background is white or grey.

This is a bit hard to explain, so I uploaded an example to imgur:

https://i.imgur.com/xXpRtsc.png

I deliberately chopped this off, so if you look at the bottom right corner of that
image, I think you can quickly see the problem: that ~white rectangle
kind of flows into the white font colour and the orange font colour. It's a
very minor thing, not sure if it is worth reporting, but I just report it in
the event it may have been missed.

There are various ways to improve this (if you come to the same conclusion
that this is not ideal). I'll give just two suggestions but of course there are
others. A simple one is to have the whole main div for the blog content
have a black background. That should solve this easily.

The drawback is that the background image can not be seen. So the
second suggestion may be to fiddle around with opaque in CSS.
Not sure if it is via e. g. opacity: 0.5; but something to e. g. have the
background blackish, but a bit transparent still, with the idea that the
background still gets a stronger contrast (e. g. the changed div
would be a bit darker than before, but not totally black-ish). Anyway
that's it, keep the glimmer spirit up! \o/

[Small idea / question] Customizing Glimmer Tetris?

Heya andy,

This is mostly a small-ish question.

Is it possible to "customize" tetris? Specifically colours and
perhaps gradient for use of the individual blocks.

I assume some customization is possible e. g. you use:

block_size: BLOCK_SIZE

So I suppose one can tweak that. But is the same possible
for colours/fill? Can there be a black border around individual
tetris elements? like a 1px solid black border?

What about gradients, e. g. if we have the large I-shaped
tetris block, can this be styled individually too via gradient?

Since SWT probably allows most flexibility it may suffice if
the code could mention this perhaps? If it is too complicated
to support don't worry about it. I did not see colors at
https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/v4.18.3.1/samples/elaborate/tetris.rb
so I assume it is stored elsewhere.

glimmer package --> Error: Invalid Option: [packages/bundles]

jpackage --type --dest 'packages/bundles' --input 'dist' --main-class JarMain --main-jar 'gxg_studio_glimmer.jar' --name 'Gxg Studio Glimmer' --vendor 'Gxg Studio Glimmer' --icon 'package/windows/Gxg Studio Glimmer.ico' --app-version "1.0.0" --license-file LICENSE.txt --copyright "Copyright (c) 2020 studio" -name 'Studio' -title 'Studio' -Bmac.CFBundleName='Studio' -Bmac.CFBundleIdentifier='org.studio.application.Studio'
WARNING: Using incubator modules: jdk.incubator.jpackage
Error: Invalid Option: [packages/bundles]

Am I missing a build .deb or other package/dep?

[Related to the RubyConf 2022 Talk in about 3 months] If you have time during the talk, could you also mention future ideas and goals for glimmer?

Hey there Andy,

You mentioned recently on your blog that you will be speaking at the rubyconf 2022.

Now - I am aware that speakers have a time constraint so you may not have time to talk about everything
and have to be selective.

IF however had you may have some time, could you also mention some future ideas for glimmer? Obviously
within just a few minutes you can't cover everything but perhaps an idea or two related to the future ("the
future is hard to predict") could be ok? It would be interesting, evidently for me but perhaps also for other
folks who may wonder "what's coming up next for glimmer". There are only 24 hours a given day, so you
have to focus and prioritize - absolutely understandable.

To make this question not solely "meta", leaving you too clueless, I give a few questions - don't worry
about them here, these are just some "idea givers" or "shaping glimmer" related. Not all are equally
important, they really are just to give some "what could be asked" context/questions.

  • How many videos do you plan on publishing in total? :D

  • Will there be a glimmer DSL that can be automatically tested (a glimmer specification) by others to
    re-implement or add support (a bit like rubocop, but testable, so some kind of "spec")?

  • Is glimmer really trying to take over the world?

  • How to get people to commit to a global glimmer "store" (or, simpler, applications written and
    supported in glimmer, and also in regards to long term maintenance, e. g. if glimmer itself
    changes over the years, whether it may still support legacy applications written years ago)

  • With GraalVM we can have statically compiled native binaries at the least on linux, perhaps
    on windows in the future as well. Would we then be able to pack up glimmer applications in
    that way?

  • Will glimmer try to adapt to more GUIs such as SDL/Gosu or any other variants?

  • How would examples look about existing GUIs that want to make use of glimmer, but
    without a full rewrite? E. g. only using individual glimmer components and widgets
    without a full rewrite of the underlying base.

Anyway. The above are just some random questions; don't worry about them here. But
perhaps these can give a few ideas for one or two "outlooks" for glimmer in the future
for your talk. Again, totally understandable that with time constraints you have to
focus on a few things and ignore other aspects. I remember at university giving
talks and presentations where the audience wasn't paying much attention - giving
good presentations is not easy!

(As this is not related to glimmer itself really, I'll close this issue so that it does not
interfere with the other issue requests.)

[Idea] glimmer + curses / ncurses

So, as always, please feel free to ignore/disregard.

Lately I was thinking of oldschool terminal interfaces and ... curses popped up. Aka
ncurses.

"Accidentally" I found this gem:

https://github.com/Muriel-Salvan/curses_menu

I tested some examples, such as the submenu variant:

https://i.imgur.com/H6Jo3rF.png

Sure, does not look great, but we can kind of have a terminal on the
commandline, which can be useful in some cases.

My thinking here was this, though: "what if glimmer could abstract
away all of that for us" aka write the code logic once and then glimmer
auto-generates and yields all these thingies, including the ncurses
part. So, a toplevel menu could then be translated into such a
submenu, and so on and so forth.

I am sure you have more than enough things on your hands, but
I think if this would be possible in glimmer one day, that would be
pretty cool. Who knows - perhaps some rubocop-style autogenerator
for glimmer where we can autogenerate all code for other languages,
and then as our final step obsolete us, enter ChatGPT (aka machines
write the code) and call it a day! Anyway, I only wanted to point this
out quickly.

I guess .gemspec should explicitely require Ruby >=2.5 otherwise you are able to install it but for no use

  • OS: macOS 11.4
  • Ruby Version: 2.3.8 rbenv
  • Glimmer Libraries/Versions: glimmer-0.10.4, glimmer-dsl-tk-0.0.6
$ irb
irb(main):001:0> require "glimmer-dsl-tk"
TypeError: {:keyword_init=>true} is not a symbol
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/observer.rb:28:in `new'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/observer.rb:28:in `<module:Observer>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/observer.rb:12:in `<module:DataBinding>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/observer.rb:4:in `<module:Glimmer>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/observer.rb:3:in `<top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-0.10.4/lib/glimmer/data_binding/model_binding.rb:2:in `<top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-dsl-tk-0.0.6/lib/glimmer/dsl/tk/list_selection_data_binding_expression.rb:23:in `<top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-dsl-tk-0.0.6/lib/glimmer/dsl/tk/dsl.rb:23:in `block in <top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-dsl-tk-0.0.6/lib/glimmer/dsl/tk/dsl.rb:23:in `each'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-dsl-tk-0.0.6/lib/glimmer/dsl/tk/dsl.rb:23:in `<top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/gems/2.3.0/gems/glimmer-dsl-tk-0.0.6/lib/glimmer-dsl-tk.rb:34:in `<top (required)>'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
	from /Users/nakilon/.rbenv/versions/2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in `require'
	from (irb):1
	from /Users/nakilon/.rbenv/versions/2.3.8/bin/irb:11:in `<main>'

glimmer-gtk ?

Hey there Andy,

I noticed you wrote quite a lot of glimmer-libui related code.

glimmer right now shows this as overview for supportable DSLs (or DSL-like components):

glimmer-dsl-swt
glimmer-dsl-opal
glimmer-dsl-xml
glimmer-dsl-css
glimmer-dsl-tk
glimmer-dsl-libui

May I suggest ruby-gtk3 as well? I don't mean to support all of gtk
but a subset, e. g. about the same that libui supports (which uses
gtk on linux too unless I am mistaken).

So for example ...

Gtk::Window
Gtk::Button
Gtk::Entry
Gtk::Box (:horizontal and :vertical)

and a few more elements. Of course you could go fancy and add CSS as-is,
and like combine it via glimmer-css, but time is limited, so I think adding just
basic support for gtk via glimmer may be nice to have.

There are many more things glimmer could support, such as gosu - there
are a few GUI-elements in gosu, but I don't quite suggest it since it requires
more work. :D ruby-gtk3 however had works quite nice, and this could just
be for the basic gtk-support. (Sadly I was not able to get it to work on
windows yet, but ruby-gtk3 works on linux very well.)

Anyway this is just a suggestion, please feel free to close this at any moment
in time. Thanks for reading!

[Minor suggestion for future video content] A video in regards to "workflow use" / computer setup, from the point of view of glimmer, but also aside from glimmer

Hey there Andy,

On your latest blog entry you feature tetris (again). :D

And you also encouraged remarks e. g. "If you have any questions".

You are now at video #33.

I think most videos feature individual aspects of glimmer, e. g.
widget use, different applications, code, style, showcasing,
demo - these things.

But I think it would be nice if you could make a "special"
video one day, perhaps at entry #40 or something that is
a bit different.

Ok so what do I mean with "different"?

Well, I actually mean this in the context of how YOU use the
computer. I mean both in regards to generic/general use
case, but also specifically for glimmer. Let me explain what
I mean.

I assume you use OSX primarily (I think); I am more used to
a linux workflow, so I literally use the commandline a lot.

Consider that you want to create a new application. I assume
you perhaps start with SWT (or libui, either way, this is just
as an example).

So what I think would be interesting to see would be LITERALLY
the steps you go through from CREATING a NEW application.

I understand that sometimes thinking takes place :D so I am not
saying EVERYTHING should be included in the video. But I think
it would be interesting to see how you approach this, via code
as-is. A bit like a "live" coding session - see the author of
Natalie who sometimes features videos similar to that.

For instance, I found this video accidentally some days ago:

https://www.youtube.com/watch?v=m-FEuur8xLo&list=PLWUx_XkUoGTq-nkbhnk6PN4m109ISo5BX&index=74

What to me was interesting was his workflow, e. g. vim + C++.

I think something like this may be interesting. I am not saying you should
copy that 1:1; the video on the head is (for me at the least) quite irrelevant,
but the code + workflow + commentary is really really neat.

I am also not suggesting you change your video style at all! I am more
saying "something a bit different".

So, what would we then, as viewer, see, or could learn from?

Well - the learning part is nice, so I think it would be nice to see how YOU
approach designing a new widget. Ideally something new, and something
that is not too simple and not too difficult. Just like literally something you
could create in 1-3 hours time (from start), and that would be something
useful. Like tetris. Or a game. Or some note-taking application or something.
It can be anything really. The important part is to show the usage pattern
and work flow.

IF possible it would be nice to see this written in SWT aka "glimmer in
glimmer" but this is not so important compared to seeing the workflow.

The length, well - could be 20 minutes to 1 hours or so. I think more than
that is hard to follow. I don't watch all videos usually but select a subset
and scan through a bit when it is interesting.

Anyway. This is just a suggestion.You are probably mega-busy with
different things, so perhaps this is for the next year. Or perhaps
video #50 or something.

TL;DR: Please consider making a workflow video, related to glimmer
but also the general approach.

(PS: This may also be interesting for rails folks, and those who may
want to learn about rails, indirectly, in the sense that you have a
rails background as well, whereas not every viewer has a rails
background. See kojix2 and the <= => data binding situation or
whatever it was. That was also new to me by the way. I know only
very little rails; I only built a few hello routes or show-the-time
routes. But I wrote quite a bit of sinatra code so I am somewhat
familiar with sinatra.)

Glimmer Video Request +1 - a dedicated video for "styling glimmer" applications

Hello there Andy,

You are now at video number #35. So I had this mostly ad-hoc request.

Do you think you could add a specific video (does not have to happen
soon, perhaps some day in the future) about "styling glimmer"? That
is specifically to style glimmer-apps in different ways.

This means colours of course, different fonts (when possible) but
also certain effects, e. g. fade-in or fade-out (if these are
possible; in ruby-gtk3 + CSS this is doable for some elements
for instance). You could also show transition effects in drawable
widgets - I also classify this as "styling". Padding and margin
too.

So the idea would be that if someone wants to learn glimmer, and
wants to make it "look prettier", one could point at that video.

(If you already showed this then please ignore this here - I
watched some of the videos partially, but not all so I may not
know all of them.)

This can be shorter in length than normally, so perhaps around
10 minutes or so, however you feel to fit "naturally" content into
a video that relates to the theme/topic styling. (Would be cool
if this could be applied to both desktop and web-use, but this
is an aside.)

Either way please feel free to disregard/close/proceed as you
wish, like always. Time is a finite resource after all. :)

PS: A bit off-topic, but I wanted if there is a glimmer support
for a RESTful API, e. g. to use a REST-API like in rails or
sinatra but have this be mapped 1:1 onto a widget automagically
if possible. Not sure how this could look, but it would be nice to
have this available in a standalone widget too, without needing
to start sinatra and then use a browser, for instance. Kind of like
making this all doable within a widget.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.