Comments (3)
I didn't finish reading your very long message, but half-way through reading it, I know the answer already.
What you ask for is ALREADY supported!
It's part of the reason why I encourage people to now build Glimmer DSL for LibUI apps with include Glimmer::LibUI::CustomWindow
or Glimmer::LibUI::Application
. If you build your app that way, it AUTOMATICALLY becomes a REUSABLE custom control (custom widget) that you can EMBED in another app!
I am in the middle of watching a baseball game. When I have some free time, I'll finish reading your message and respond with some examples.
Cheers and keep the ideas coming! But, I also hope to see more contributions or complete works from you in the future in addition to ideas! Open-source is always a two-way street.
from glimmer.
Here is an example of reusing an app as a component (as I mentioned it is already supported).
First run this command under CRuby:
gem install rubio-radio
Next, add the following code to a file called launcher.rb
:
require 'glimmer-dsl-libui'
# import reusable component defined with `include Glimmer::LibUI::CustomWindow` in Rubio-Radio
require 'rubio/view/radio'
include Glimmer
# instantiate the custom window component called `radio` from Rubio-Radio, and pass `backend: 'vlc -I rc'` required option.
radio_window = radio(backend: 'vlc -I rc')
window('Launcher') {
margined true
vertical_box {
label(' Click on one of these buttons to launch an app. ') {
stretchy false
}
button('Rubio Radio') {
stretchy false
on_clicked do
radio_window.show
end
}
}
}.show
Now, run:
ruby launcher.rb
You should get this screen:
Afterwards, you can click the button saying Rubio Radio, and you get this screen:
By the way, components are called "Custom Keywords" in Glimmer DSL for LibUI. I know I've mentioned them to you before in other issues:
https://github.com/AndyObtiva/glimmer-dsl-libui#custom-keywords
From the link above: "Custom keywords can be defined to represent custom controls (components) that provide new features or act as composites of existing controls"
In Glimmer DSL for LibUI, components that are represented by Custom Keywords are either Custom Controls (including Area-Based Custom Controls) or Custom Windows. All of that is mentioned in the last link shared above.
Every application written with an entry point class that has include Glimmer::LibUI::Application
or include Glimmer::LibUI::CustomWindow
will become a reusable custom window component that you can launch from another app as a separate window.
Also, if the application author exposes the main body of their custom window as a separate custom control mixing include Glimmer::LibUI::CustomControl
(representing what you call the core component or meat of the window), then you can embed their main GUI directly in your application's window instead of launching as a separate window, by doing the same thing as in the code above, but embedding the custom control directly under a vertical_box
or tab_item
for example.
(In Glimmer DSL for SWT, components are either Custom Widgets, Custom Shells (custom windows), or Custom Shapes)
Sometimes I wonder if you've paid any attention to what you read in Glimmer DSL for LibUI documentation or what you learned from its examples. The support for components was mentioned many months ago. I am surprised you asked for it in a new issue instead of simply knowing it exists and just using it successfully as demonstrated in examples.
I think you have a memory problem. Every once in a while, I mention to you all sorts of supported features, but you forget them a month later as if I never mentioned anything. Or, you ask me a question in an issue, I tell you no, and then a month later, you ask me the same question again. You might need to lighten up the load of your work on you. If you are working too hard, then work is hurting you. Or, maybe spend more time refreshing your soul with Christian worship. That helps people refresh their mind and body, and maintain strong memory and thinking faculties. I can attest to it as I go to Church and pray to God regularly.
Anyways, I'm closing this issue because it is already supported.
from glimmer.
About this part of your write-up:
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.
This is completely wrong!
Everyone must be using Glimmer DSL for LibUI because it is 100% simpler in ALL cases than writing C-style code in Ruby.
What you're proposing is like asking developers to write Assembly code in Ruby. That's what using the LibUI C binding directly feels like. That is a non-starter. Only an intentionally idiotic programmer would try to write Assembly code in Ruby instead of just writing Ruby style code via a friendly Ruby DSL. There is ZERO value in supporting idiotic actions like that.
The whole point of Glimmer is to enoucrage everyone to write 1/2 to 1/10 of the code that is automatically protected from memory garbage collection problems and pointer issues using Glimmer DSL for LibUI. We don't want to encourage stupidity. Otherwise, writing Ruby GUI applications will be just as bad as it always was without using Glimmer, which is the reason why not many people use Ruby for building GUI apps. We intentionally do NOT want to support such applications and want to discourage them completely. If people want to choose to be idiots, they are alone in their path. I do not support idiotic actions and do not want idiots using Glimmer. I only want smart people using Glimmer who either get Glimmer right away intuitively or are quick learners and will see why Glimmer DSLs provide the simplest way possible for building GUI.
This is exactly like how DHH didn't want Java and PHP idiots in the past polluting Rails with their awful ideas. Because they wanted to support idiotic things like dependency injection and embedded queries in the view. He just ignored them. And, the badness of their ideas shows up in their work. A website written in Java that is trying to do what Rails does will be least 4 times the amount of code if not more, and is much more complex. Thankfully, DHH was smart enough not to support idiots who want to build idiotic apps like that while claiming Rails was not good for everyone
from glimmer.
Related Issues (20)
- Feature Request: GraalVM Native Image HOT 3
- [Request / Idea] [Idea for a somewhat succint glimmer-related video] How to install and set up different glimmer projects
- [Idea / Discussion] Glimmer up EVERYTHING! \o/ HOT 1
- Add support for slint-ui HOT 1
- [Idea/Suggestion - please feel free to ignore/close at any moment in time] Glimmer for the terminal? HOT 2
- Glimmer "store"? HOT 2
- [Suggestion, low priority] Provide "statistics" and information about the whole glimmer suite in some way, or perhaps several ways HOT 1
- Glimmer gosu support? (This is more a question though) HOT 1
- [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 HOT 1
- Battleships - a few not-so-important comments/suggestions, please feel free to ignore/close at any moment in time HOT 6
- [Small idea / question] Customizing Glimmer Tetris? HOT 1
- [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? HOT 1
- [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 HOT 5
- Glimmer Video Request +1 - a dedicated video for "styling glimmer" applications HOT 3
- [Idea, please close as desired] Glimte-Glimmer for Everyone \o/ (GUIs everywhere) HOT 1
- [Idea] glimmer + curses / ncurses HOT 1
- [Idea] "Standardized" glimmer components HOT 3
- Glimmer statistics (aka overview)? HOT 1
- Enable GitHub Discussions on all glimmer repos HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glimmer.