Giter Club home page Giter Club logo

glimmer-cs-gladiator's Introduction

Gladiator 0.11.2 - Ugliest Text Editor Ever!

Gem Version

(Montreal.rb Talk - How I Built My Code Editor in Ruby)

rapid prototyping of desktop app GUI with Gladiator

Mac

Gladiator

Windows

Gladiator

Gladiator (short for Glimmer Editor) is a Glimmer DSL for SWT beta project under on-going development that explores how to build a text editor in Ruby using Glimmer DSL for SWT (JRuby Desktop Development GUI Library). It is not intended to be a full-fledged editor by any means, yet mostly a fun educational exercise in using Glimmer. Gladiator is also a personal tool for shaping an editor exactly the way I like, with all the keyboard shortcuts I prefer. I leave building truly professional text editors to software tooling experts who would hopefully use Glimmer one day. Otherwise, I have been happily using Gladiator to develop all my projects since May of 2020.

You may now download a packaged version of Gladiator, including new support for Mac ARM64

Features

Gladiator currently supports the following text editing features (including keyboard shortcuts with Mac CMD=CTRL/CTRL=ALT on Windows/Linux)

Gladiator Demo

Text Editor

  • Text Editor with Colored Syntax Highlighting for Multiple Languages
  • Show Line Numbers
  • Multi-tab support (CMD+SHIFT+[ & CMD+SHIFT+] for tab navigation. CMD+1-9 to jump to a specific tab)
  • Drag and drop split pane (drag a file from File Tree or File Lookup List, and it splits the pane)
  • Duplicate Line(s)/selection (CMD+D)
  • Kill Line(s)/selection (CMD+K)
  • Move line/selection up (CMD+UP)
  • Move line/selection down (CMD+DOWN)
  • Comment/Uncomment line/selection (CMD+/)
  • Indent/Unindent line/selection (CMD+] & CMD+[)
  • Insert/Prefix New Line (CMD+ENTER & CMD+SHIFT+ENTER)

File Explorer Tree

  • Collapsable file explorer tree listing files and directories for open project
  • Context menu to open file, rename, delete, add new file, add new directory, and refresh tree
  • Jump to open file in tree (CMD+T)

File Lookup List Filter

  • Collapsable file lookup list filter (CMD+R)
  • Semi-fuzzy filtering by ignoring slashes, underscores, and dots to ease lookup

Navigation Area

  • Show current text editor file name 0- Show file navigation stats (Caret Position / Line Position / Selection Count / Top Pixel)
  • Jump to Line (CMD+L)
  • Find & Replace (CMD+F)

Menus

  • File Menu:
    • Open Scratchpad for running arbitrary Ruby/Glimmer code (saves a temporary file to project_dir/.gladiator-scratchpad) (CMD+SHIFT+S)
    • Open Project (CMD+O)
    • Quit Project (ALT+F4)
  • View Menu
    • Split Pane
      • Orientation change to Horizontal/Vertical (CMD+SHIFT+O)
      • Maximize Pane: maximizes current pane in split pane to take entire area (CMD+SHIFT+M)
      • Reset Panes: resets pane sizes if split width/height was adjusted (CMD+SHIFT+P)
      • Unsplit: closes the second pane (CMD+SHIFT+U)
    • Maximize Editor: maximizes editor area to hide file lookup list and file explorer tree (CMD+CTRL+M)
    • Reset All: resizes sizes of all areas in the editor (CMD+CTRL+R)
  • Run Menu to run Ruby code (CMD+SHIFT+R)

Watch External Changes

  • Watch open file for external changes to automatically refresh in editor
  • Watch project subdirectories for changes to automatically refresh in file explorer/file lookup

Automatic Data Management

  • Autosave on focus out/quit/open new file
  • Remember opened tabs, caret position, top pixel, window size, and window location
  • Default "ignore paths" to avoid bogging down editor with irrelevant directory files

Multiple Language Syntax Highlighting

Here is an exhaustive list of all the file formats supported by Gladiator (if you would like support for more file formats, feel free to suggest in a GitHub Issue or submit a Pull Request):

  1. C ('c', 'h')
  2. C++ ('cpp', 'cc', 'C', 'cxx', 'c++', 'hpp', 'hh', 'H', 'hxx', 'h++')
  3. C# ('cs')
  4. Crystal ('cr')
  5. CSS ('css')
  6. Conf ('conf')
  7. CoffeeScript ('coffee')
  8. Elixir ('ex', 'exs')
  9. Embedded Elixir ('eex', 'leex', 'heex')
  10. ERB ('erb')
  11. Gherkin Feature ('feature')
  12. Gradle ('gradle')
  13. Haml ('haml')
  14. HTML ('html')
  15. INI ('ini')
  16. Java ('java')
  17. JavaScript ('js', 'cjs', 'mjs', 'es6', 'es')
  18. JSON ('json')
  19. JSP ('jsp')
  20. JSX ('jsx')
  21. Kotlin ('kt', 'ktm', 'kts')
  22. Lisp ('lisp', 'cl', 'el', 'asd')
  23. Make ('Makefile', 'makefile', 'GNUmakefile')
  24. Markdown ('md', 'markdown')
  25. Diff Patch ('patch')
  26. Perl ('pl')
  27. Plist ('plist')
  28. Puppet ('pp')
  29. Properties ('properties')
  30. PostScript ('ps')
  31. PowerShell ('ps1')
  32. Python ('py')
  33. Ruby ('rb', 'rbw', 'rake', 'gemspec')
  34. Rust ('rs')
  35. SASS ('sass')
  36. Scheme ('scm', 'sps', 'sls', 'sld')
  37. SCSS ('scss')
  38. Shell ('sh')
  39. SQL ('sql')
  40. Tcl ('tcl')
  41. TypeScript ('ts')
  42. TSX ('tsx')
  43. Yaml ('yaml', 'yml')
  44. XML ('xml')

Platforms

  • Mac: Gladiator works best on the Mac. This is the platform it is most used on and receives the most maintenance for.
  • Windows: Gladiator works OK on Windows, but has a few annoying issues.
  • Linux: Gladiator works with handicaps on Linux (performing some text editing operations causes scroll jitter). Contributers could help fix.

Pre-requisites

Download

Download Gladiator 0.11.2 Mac DMG Installer (ARM64 Ventura 13.4.1 & Older) (this version starts in about 2.5 seconds)

Download Gladiator 0.11.1 Mac DMG Installer (x64 Ventura 13.4.1 & Older)

Download Gladiator 0.10.0 Mac DMG Installer (x64 Catalina & Older)

Download Gladiator 0.10.0 Windows MSI Installer (x64 Windows 10)

The packaged version starts with a dialog asking you what project to open. Gladiator does not fully show up until you have selected a project directory.

Otherwise, if you prefer a command line version, then follow the Setup Instructions below.

Setup Instructions

Note: if you encounter any issues, check if they are documented in TODO.md, issues, or pull requests as they might be on my radar to fix. Otherwise, please report as an issue or better yet fix and submit a pull request. Also, try going back to a previous version of the gem until you find one that works. Keep in mind this is open-source software provided as is, so there are no guarantees of functionality. If you would like such guarantees, you are welcome to hire me full-time.

Install Gladiator gem by running (jgem, jruby -S gem, or gem directly if you have RVM):

jgem install glimmer-cs-gladiator -v0.11.2

Or add to a JRuby project Bundler Gemfile under the :developement group:

group :development do
  gem 'glimmer-cs-gladiator', '> 0'
end

Run (jruby -S bundle or bundle directly if you have RVM):

jruby -S bundle

Afterwards, if you are using RVM and want to ensure system wide availablility of the gladiator command across Ruby versions, run this command in an environment that has JRuby (not needed without RVM):

gladiator-setup
source ~/.gladiator_source

You should be able to run gladiator from anywhere now.

You can pass a project path as a first argument to open a particular project.

Alternatively, open in app mode (gives you a dialog to open any project) by passing APP_MODE=true argument/env-var.

Usage

You may run the gladiator command to bring up the text editor in the project directory you would like to edit:

gladiator

On Linux, you may need to run with extra memory via this command instead:

gladiator -J-Xmx1200M

On Windows, you may need to run with extra memory via this command instead:

gladiator -J-Xmx3000M

If you are in a different directory from the project you would like to edit, then pass its path as an argument:

gladiator relative-or-absolute-path/to/project

Note: If you cloned this project and bundle installed, you may invoke via bin/gladiator instead.

Glimmer Custom Shell Reuse

To reuse Gladiator as a Glimmer Custom Shell inside another Glimmer application, add the following to the application's Gemfile:

gem 'glimmer-cs-gladiator', '~> 0.11.2'

Run:

jruby -S bundle

And, then instantiate the Gladiator custom shell in your Glimmer DSL for SWT application via the gladiator keyword assuming you already have include Glimmer in your class, module, or main object.

Env Var Options

Gladiator supports these environment variable options.

LOCAL_DIR

(String / default: '.')

Gladiator opens with the current directory as the root by default. If you would like to open another directory, set LOCAL_DIR environment variable.

Example:

LOCAL_DIR="/Users/User/code" gladiator

Opens Gladiator with "/Users/User/code" as the root directory.

APP_MODE

(true or false / default: false from terminal/command-line and true from packaged Gladiator)

Specifies whether to run in app mode, thus providing a dialog to open any project path instead of starting with a specific project from the get-go.

Example:

APP_MODE=true gladiator

Configuration

Gladiator automatically saves configuration data in a .gladiator file at the directory it is run from. It may be edited to add extra ignore paths.

It currently remembers:

  • Last opened files (in both split panes if split)
  • Window size and position
  • Ignore Paths under Glimmer::Gladiator::Dir::IGNORE_PATHS (default: ['.gladiator', '.git', 'coverage', 'packages', 'node_modules', 'tmp', 'vendor', 'pkg', 'dist'])

Gotchas

Signaling Error

Gladiator repetitively displays a signaling error that is harmless in practice:

The signal HUP is in use by the JVM and will not work correctly on this platform
The signal INT is in use by the JVM and will not work correctly on this platform
The signal TERM is in use by the JVM and will not work correctly on this platform

App Is Not Responding

If you run the gladiator command from the root directory or some parent directory to many projects, it assumes that is the project directory and attempts to pre-load all files (just part of Gladiator's architectural design and assumptions for optimizing use per project), taking a very long time and not responding for quite a while.

To avoid this problem, always make sure you are running the gladiator command from a single project's directory.

Also, if you encounter this issue with projects that contain a lot of extra files that you do not need to edit, you could later open the generated .gladiator file at the root of the project directory and add unnecessary subdirectories to the ignore_paths array.

Freezing in large projects

Gladiator right now assumes smaller projects with a few files only as it always opens all file contents in memory for better searching. So, when a file is updated externally (e.g. change git branch), it reloads its entire tree, including all the file contents too, which causes a temporary freeze. This may get fixed in the future, but it is not annoying enough in smaller projects to be fixed right away. The change might include diffing the tree to avoid refreshing file contents for unchanged files, and perhaps multi-threaded loading of file contents to avoid freezing the GUI.

TODO

TODO.md

Change Log

CHANGELOG.md

Contributing to glimmer-cs-gladiator

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
  • On windows, add this Git config: git config core.autocrlf input (or globally if you're working on multiple Glimmer projects)

Copyright

MIT

Copyright (c) 2020-2022 Andy Maleh. See LICENSE.txt for further details.

--

Built with Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)

Gladiator icon made by Freepik from www.flaticon.com

glimmer-cs-gladiator's People

Contributors

andyobtiva avatar dependabot[bot] 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

Watchers

 avatar  avatar  avatar  avatar

Forkers

rubycoder

glimmer-cs-gladiator's Issues

[Idea] Consider adding a "generic, componentized editor" to the whole glimmer suite (in addition to gladiator, or, perhaps extending gladiator's use cases to also include simple editor variants) [update: focus on Glimmer DSL for LibUI only]

So this suggestion is a tiny bit more "serious", but, as always the disclaimer
is to please feel free to ignore/close/modify in any way shape or form.

Before I describe it in more details, let me also preface that evidently your time is
limited and you have been doing tons of stuff lately in regards to glimmer - your
comparison to shoes (I think we can call why's original shoes more like as
a basic first step towards DSL-syntax), glimmer + video stuff (widget)
and glimmer + wxruby3. On gladiator you also point out that your goal is NOT
to write a mega-super-feature-rich editor with a billion features.

This suggestion here is a bit more on a per-app specific suggestion, a bit
like kojix2 libui-radio widget focusing on playing audio files, but I will focus
on ... an editor.

I'll explain that in a moment, but I would also like to point out that
you have that editor widget via SWT called "gladiator":

https://github.com/AndyObtiva/glimmer-cs-gladiator

You also provide a screenshot on windows, so I assume that it works very
well on windows - this already covers one "use case necessity" I have
with my suggestion here, which I will explain in a moment:

https://github.com/AndyObtiva/glimmer-cs-gladiator/raw/master/images/glimmer-gladiator-windows.png

I do not know how easy it is to customize your editor. The more customizable
the better, I think.

I believe that one small issue may be that users may need java and swt
on windows too, right? It is probably not a big deal, but I mention it
just in case, since this can provide a small obstacle to some folks
(even though you tend to provide excellent documentation, which I think
is always good, even if it may sometimes appear "too much" - personally
I ALWAYS prefer projects that rather have too much documentation than
projects that lack documentation. In my experience the latter tend to
be abandoned more easily too, but I digress, so back onto the topic.)

For instance, in the past I did not even know how to install java - it took me
a while how to figure that out, and lateron I was using just Graalvm's
java variant, which works fine on windows too.

I was not doing much libui-related stuff in the last 6 or 8 weeks or so, but
lately my interest has increased again, in part due to the video-widget thing
you showed.

I still want some kind of mega-IDE or platform via libui-ng+ruby
on windows - like all apps would have something that can relate
to libui too! And we could use these on windows without necessarily
needing windows. (Or on all platforms, actually - the glimmer desktop!) :D

Anyway.

Yesterday I looked at kojix2' libui bindings again, and in the examples
I noticed the simple editor:

https://github.com/kojix2/LibUI/blob/main/examples/simple_notepad.rb

Well, it does not really have any features, but actually I think this
is also not bad, IF we can think of this as a "componentized editor".

With that I kind of mean to allow the user to declare/define how
feature-rich an editor is.

Now let's for a moment assume it were possible to have an editor
like gladiator via libui-ng one day, just for the sake of
the idea here.

People could kind of declare how feature-rich that editor would
be.

In pseudo-syntax from glimmer commandline, say this:

glimmer --simple-editor
glimmer --medium-editor
glimmer --gladiator # as means to just start the gladiator editor,
                    # through bin/glimmer or whatever the name of
                    # the executable would be; as an example how to
                    # start any glimmer-app actually, so if we'd
                    # have a "glimmestore" like an "appstore",
                    # we could still use the glimmer executable
                    # to start any of these, and integrate the
                    # installed stuff into the --help display for
                    # bin/glimmer as well as include that 
                    # functionality, like "glimmer --tetris" and
                    # so forth. I hope you understand my idea,
                    # where we can start any glimmer-app from the
                     # commandline too, 
                    # but this is the smaller idea, so let's
                    # continue with the main editor

The basic idea here is to be able to offer a "componentized editor"
as much as possible via glimmer, in as many different GUIs as
possible, including the www stack. Again, this is just an idea -
please don't assume it is my attempt to say "I'm gonna use Andy's
spare time because I myself am too lazy to do it". :)

So, what could be a slightly more feature-rich editor?

Three small examples:

  • Offer a save-buffer functionality (per tab)
  • Offer tabs on the editor to allow user to modify multiple files
  • Offer a second widget keeping track of the line numbers

And so on and so forth, increasing the feature set, until it
eventually reaches the complex feature set that gladiator allows.

So the idea here is that the user could ideally have as many
or as few components possible, while still having an editor.
Like a really adjustable editor.

The primary focus here I'd see is on windows. On Linux I tend
to use an ancient editor, but on windows I sometimes just
need notepad, and notepad is mega-simple really. I think
libui-ng could be used as a notepad replacement too, but
even as a more extended editor. (Obviously you already
cover that use case via gladiator on windows, but I am
thinking more in terms of libui-ng or any other feature
set here, including the www stack, perhaps via opal too.
Having it work on the browser would be kind of cool too, like
we could have an editor that we could use in the browser. In
practice this may be a bit difficult since browsers tend to be
in a sandbox environment, but, if it were possible to save
files via a browser easily that would be great. Perhaps node/npm
allows for that already; I know too little about that to be able to
tell. I am more thinking about this in terms of "as many platforms
and areas as possible")

So why do I think that an editor would be important and useful?
Why should it go and become part of a "glimmer apps spec"?

You already offer several applications, including games -
like snake game, tetris game and so forth. So you kind
of have an "appstore" already, if we look at these as
apps - the "glimmerstore". :D (I can already envision a
logo for that ... anything that sparkles with glimmer
and like a candybox hehehe... or like a loot box or
a treasure box or something. Anyway.)

I believe that an editor could be useful to have for the
glimmer suite in the long run. And, starting with a
SIMPLE one, like a "clone" of notepad.exe to keep it
simple too. But, if a user wants more features, to also
offer that.

Now writing a complicated, feature-rich editor can be
a lot of work - we see that via vim and emacs. I am
not proposing that this goes over-board really, so
my idea is also to CONFINE it to specific "components"
that are used in many different editors.

Technically this can all use the same code base - well,
glimmer kind of does that, yes? We can shuffle and
exchange code and it may work for many things, like,
again a contrived example:

glimmer --gtk --editor
glimmer --wxruby --editor
glimmer --tk --editor
glimmer --libui --editor
glimmer --libui-ng --editor

Or, say, with an existing code base like tetris:

glimmer --gtk --tetris
glimmer --wxruby --tetris
glimmer --tk --tetris
glimmer --libui --tetris
glimmer --libui-ng --tetris

I hope you can kind of see a bit what I mean here.

Having an editor available then means that people
could write code in ruby, even on windows (again,
it's already possible via gladiator I assume, but
I am thinking like of a SIMPLE editor with a FEW
features, say, 5 ones at max to keep it simple,
and then have THAT editor work on as many different
ways as possible).

If we abstract away things then we could also say
that glimmer could be a general specification
irrespective of the language. So right now glimmer
focuses on ruby and java I assume, but in theory
we could say all languages could use it and adjust
to the DSL (and the DSL then eventually being a
specification; I see that you are improving it as
you go anyway, e. g. your recent entry in the
todo file handling events via "on_event_NAME"
or something like that). And then eventually call it,
one day, the glimmer DSL or glimmer specification
(and perhaps version it, to allow users to refer to
it for stable applications).

Anyway. I'll finish that idea here. I hope it makes some
sense. I kind of envision a mega-meta-glimmer one day,
like where different people may use different languages
but even just describe what they want, without necessarily
needing to be ABLE to write code, and still have useful
features. Of course we could say that EVERY application
may be useful, and I do not disagree, but I think an
editor may be a little more important from a usability
point of view than a game (even though, of course, we
can argue that more people may enjoy playing a game
than using an editor, so I don't disagree with that;
I just consider an editor to be rather important because
I tend to write a lot of code, and I assume you in general
also tend to write a lot considering the wealth of documentation
and code. So I assume an editor is also important for your
own use case.)

Error: Glimmer keyword items with args [] can not be handled inside parent

Glimmer looks fantastic! I can't wait to give it a try.
To get an idea of what it can do, I tried running Gladiator on Windows 7 with JRuby 9.2.14.0, but I get an error while Gladiator is starting. I get the same error on Windows 10 with JRuby 9.2.13.0. Thanks for any advice.

c:\>gladiator -J-Xmx3000M
The signal INT is in use by the JVM and will not work correctly on this platform
The signal TERM is in use by the JVM and will not work correctly on this platform
[2020-12-29 17:14:00] ERROR glimmer: Encountered an invalid keyword at this object:
[2020-12-29 17:14:00] ERROR glimmer: C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:58:in `handle': Glimmer keyword items with args [] can
not be handled inside parent #<Glimmer::SWT::ShellProxy:0x1acaf3d>! Check the validity of the code. (Glimmer::InvalidKeywordError)
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/expression_handler.rb:52:in `handle'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:169:in `interpret'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer.rb:73:in `method_missing'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/lib/views/glimmer/gladiator.rb:234:in `block in Gladiator'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/parent_expression.rb:29:in `add_content'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:190:in `add_content'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:175:in `block in interpret_expression'
        from org/jruby/RubyKernel.java:1897:in `tap'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:174:in `interpret_expression'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:62:in `block in shell'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/lib/views/glimmer/gladiator.rb:194:in `block in Gladiator'
        from org/jruby/RubyBasicObject.java:2694:in `instance_exec'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/ui/custom_widget.rb:155:in `initialize'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/ui/custom_shell.rb:31:in `initialize'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/dsl/swt/custom_widget_expression.rb:49:in `interpret'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:174:in `interpret_expression'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:170:in `interpret'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer.rb:73:in `method_missing'
        from C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/bin/gladiator_runner.rb:6:in `<main>'

NoMethodError: undefined method `items' for nil:NilClass
        method_missing at org/jruby/RubyBasicObject.java:1715
        method_missing at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer.rb:78
             Gladiator at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/lib/views/glimmer/gladiator.rb:234
           add_content at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/parent_expression.rb:29
           add_content at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:190
  interpret_expression at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:175
                   tap at org/jruby/RubyKernel.java:1897
  interpret_expression at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:174
                 shell at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:62
             Gladiator at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/lib/views/glimmer/gladiator.rb:194
         instance_exec at org/jruby/RubyBasicObject.java:2694
            initialize at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/ui/custom_widget.rb:155
            initialize at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/ui/custom_shell.rb:31
             interpret at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-dsl-swt-4.17.10.8/lib/glimmer/dsl/swt/custom_widget_expression.rb:49
  interpret_expression at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:174
             interpret at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer/dsl/engine.rb:170
        method_missing at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-1.0.6/lib/glimmer.rb:73
                <main> at C:/Ruby/jruby-9.2.14.0/lib/ruby/gems/shared/gems/glimmer-cs-gladiator-0.6.3/bin/gladiator_runner.rb:6

c:\>jgem list                                          
                                                     
*** LOCAL GEMS ***                                   
                                                     
array_include_methods (1.0.4)                        
awesome_print (1.8.0)                                
clipboard (1.3.5)                                    
cmath (default: 1.0.0)                               
csv (default: 1.0.0)                                 
did_you_mean (1.2.1)                                 
facets (3.1.0)                                       
fileutils (default: 1.1.0)                           
filewatcher (1.1.1)                                  
git-glimmer (1.7.0)                                  
glimmer (1.0.6)                                      
glimmer-cs-gladiator (0.6.3)                         
glimmer-dsl-swt (4.17.10.8)                          
ipaddr (default: 1.2.0)                              
jar-dependencies (default: 0.4.0)                    
jruby-openssl (default: 0.10.5 java)                 
jruby-readline (default: 1.3.7 java)                 
jruby-win32ole (0.8.5)                               
json (default: 2.2.0 java)                           
little-plugger (1.1.4)                               
logging (2.3.0)                                      
method_source (1.0.0)                                
minitest (5.10.3)                                    
multi_json (1.15.0)                                  
nested_inherited_jruby_include_package (0.3.0)       
net-telnet (0.1.1)                                   
optimist (3.0.1)                                     
os (1.1.1)                                           
pastel (0.8.0)                                       
power_assert (1.1.3)                                 
psych (default: 3.2.0 java)                          
puts_debuggerer (0.11.0)                             
rake (12.3.2)                                        
rake-ant (default: 1.0.4)                            
rake-tui (0.2.3)                                     
rchardet (1.8.0)                                     
rdoc (default: 6.1.2)                                
rouge (3.26.0)                                       
ruby-debug-base (0.10.7 java)                        
ruby-debug-ide (0.7.2)                               
scanf (default: 1.0.0)                               
super_module (1.4.1)                                 
test-unit (3.2.8)                                    
text-table (1.2.4)                                   
tty-color (0.6.0)                                    
tty-cursor (0.7.1)                                   
tty-prompt (0.23.0)                                  
tty-reader (0.9.0)                                   
tty-screen (0.8.1)                                   
webrick (default: 1.6.1)                             
wisper (2.0.1)                                       
xmlrpc (0.3.0)            

c:\>jruby -v
jruby 9.2.14.0 (2.5.7) 2020-12-08 ebe64bafb9 Java HotSpot(TM) 64-Bit Server VM 25.261-b12 on 1.8.0_261-b12 +jit [mswin32-x86_64]   

Low priority suggestion: a short video for glimmer-cs-gladiator (perhaps around the range of ~5 minutes or something, just an intro and overview)

Hey there Andy,

The README currently has this comment:

"Otherwise, I have been happily using Gladiator to develop all my projects since May of 2020"

I think it may be interesting for some users or visitors to perhaps showcase a somewhat short video, just as an example how you may use glimmer-cs-gladiator specifically. This does not have to be long or too fancy or complicated; perhaps around 5 minutes or so, give or take, I think should suffice, with just some key examples shown here. For instance, writing a hello-world via glimmer-cs-gladiator for some examples in the glimmer-suite, including a few examples forthat, such as "go to line", remove text, replace text, change font size or something like that. Perhaps just a few entries that you mention in the current features list of glimmer-cs-gladiator, and meant as just a general introduction. It could also give users a somewhat better idea to just use glimmer-cs-gladiator as an editor, if you work with it since the last ~2 years. (I tried to write a ruby-gtk3-editor, but it is nowhere near complete, missing tons of features and I am working on it very irregularly, so this would also be interesting to see how useful glimmer-cs-gladiator could be from that perspective.)

This video could then linked in directly from the README here,or if you deem it better as part of a playlist on youtube. (Though I guess a simple directl URL is easier, unless you want to specifically integrate the video as part of the glimmer-dsl-swt or something, such as a specific featured app.)

It could be considered as a slight extension towards introducing the glimmer suite, aka "use glimmer, from within glimmer, to write glimmer-specific code/applications".

[Feature suggestion] In-built help and documentation for glimmer specific code, via glimmer-cs-gladiator

Hey there Andy,

I recently adapted kojix2 rubio example, as I did not have a glimmer-app yet in one of my gems.

While looking at kojix2' code - he is writing in a style that is very concise and short, but also shy
of comments - I found various Glimmer-specific methods, which were unknown to me at the
time.

For instance:

Glimmer::LibUI.timer()
Glimmer::LibUI.queue_main()
Glimmer::DataBinding::Observer::Proc.new

And so forth. To some extent I understand these, to a limited way, as I saw similar code in
ruby-gtk years ago; so the timer is probably just a protected call to counting how time
passes by (in "ticks"; I think GLib in gtk does something similar), queue_main I assume
is to run via a protected thread (again I am just making assumptions) and the Observer
thingy is to update the table entries shown dynamically - or at the least I am guessing
it. I have not studied the code in detail.

Now I can search for these examples and it would not be too difficult to find it, but then
I was also wondering ... "what if there is an in-built way to look up ANY Glimmer API?"

Naturally this then led me to propose this here for the glimmer-editor, as this may
make the most sense (e. g. we operate all within the glimmer-editor, so also in-built
help and documentation should ideally be available; and perhaps you already do so,
anyway). I guess in the simplest way, implementation wise, two things I can think
about:

  1. the more elegant way would be to have some dedicated small widget where, upon
    a selection of a glimmer-API, such as the three ones mentioned above, it is shown
    what this does, aka "this API conjures dragons" and "that API makes sure the application
    does not crash unexpectedly, but gracefully". You probably already have all that
    documentation stored in glimmer, so this should only be a matter of displaying that
    to the end user (or rather dev, who is using the glimmer editor, or any other glimmer
    specific widget where such help can be shown, such as the www-implementations).

  2. an even much simpler way would be to just have an input text field where we can
    type (or copy/paste) into, and then a small button we can click, which then shows
    whether this API is known or not. This one may not be as elegant as the above,
    but probably much easier and faster to implement. And if need be it could be improved
    anyway at a later time.

The rationale for this suggestion is to provide a "stay within the glimmer world"
approach, e. g. for people to operate within glimmer as much as possible, without
"needing" to leave it. Of course google search and what not may all be more
convenient, but I think there is merit to the idea that we can solve all glimmer-related
issues from WITHIN glimmer-code, like a whole glimmer environment.

I have a few more loose ideas I am certain you are eager to listen to, for the amount
of work when having limited time :D - ultimately these are just some semi-random
ideas. One I may propose, but for glimmer instead, would be for "glimmer components",
e. g. to describe glimmer-specific widgets and ready-made solutions for such widgets
in an agnostic format, in addition to the DSL (or non-DSL) that is provided/offered. But
that would be for another suggestion - end of the year is often lazy time here so not
sure how canadians go about it, but I can already feel the cold factor kicking in here,
trees dropping their leaves and it's quite cold already in central europe. Anyway I end
that here now - as always please feel free to proceed in any way shape or form with
suggestions made. glimmering into the new year soon. \o/

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.