Jump to page: 1 24  
Page
Thread overview
Is UI interesting for us?
Mar 25, 2023
Ikey Doherty
Mar 25, 2023
AnimusPEXUS
Mar 25, 2023
Adam D Ruppe
Mar 25, 2023
Salih Dincer
Mar 25, 2023
Ogi
Mar 25, 2023
Zealot
Mar 26, 2023
Ogi
Mar 28, 2023
Zealot
Mar 28, 2023
Dadoum
Mar 29, 2023
Zealot
Mar 29, 2023
Adam D Ruppe
Apr 11, 2023
IchorDev
Mar 25, 2023
Dadoum
Mar 25, 2023
Jacob Shtokolov
Mar 26, 2023
Guillaume Piolat
Mar 26, 2023
Guillaume Piolat
Mar 26, 2023
Guillaume Piolat
Mar 26, 2023
Adam D Ruppe
Mar 26, 2023
Guillaume Piolat
Mar 28, 2023
zoujiaqing
Mar 28, 2023
Dejan Lekic
Mar 29, 2023
GrimMaple
Mar 29, 2023
Dadoum
Mar 29, 2023
GrimMaple
Mar 29, 2023
Salih Dincer
Mar 31, 2023
sai
Apr 04, 2023
Daniel Kozak
Apr 04, 2023
zjh
Apr 04, 2023
ryuukk_
Apr 09, 2023
Zz
Apr 10, 2023
zjh
March 25, 2023

Most of the time I've been a backend engineer. However at times I do need to write an app, and usually I go with Gtk.

However, I'm a bit concerned that gtk-d seems .. well, catatonic. DWT also appears to be beyond life support.

We all know Rust has iced-rs, which due to the design of Rust has had to adopt the Elm paradigm.

D, with features that honestly don't need reiterating, could trivially manage OOP, ECS, mixins...

Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

I have a selfish interest in this, hence asking. While spinning a ui toolkit isn't hard, doing it properly can be (accessibility)

March 25, 2023

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

...

some time ago I've started some GUI project https://github.com/AnimusPEXUS/dtk , but I've stuck on wayland support. I'd could continue If wayland bindings would be ok https://github.com/AnimusPEXUS/dtk/issues/1. also EGL bindings would be great (but I can't really tell, as I didn't experimented with it yet). also I don't mind if somebody fork and continue doing dtk it self.

originally I've developed it with SDL support but in wayland SDL can't get window properties properly. and currently I can't continue with dtk right away.

March 25, 2023
On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:
> Is there general interest in UI within the D community?

As in most fields, I've done my own thing in my minigui.d. My general strategy has been on Windows, it uses the native controls where possible so things just work there, then the Linux version is 100% custom (and almost all self-contained, since I don't wanna bring in annoying outside libs).

This has some interesting effects: some surface level things are easier to do on linux but the deeper things are... more possible but less realistic.

Accessibility is one example, on Windows it mostly just works. I tested it with nvda and such, the basic classes - being built on native controls - work fine. Custom widgets of course nothing yet. On Linux, it just plain doesn't work at all. I expect it'd be possible to tie into gtk's api or something but i just have zero familiarity with it. I've glanced down the docs, I think I can do it, but that's as far as I've gotten.

But doing things myself on linux has also been interesting. I'm told that doing per-monitor fractional scaling is completely impossible. Gtk does not seem to support it. I do. It wasn't even that hard, so I don't get what the fuss is about...

On the other hand, it took me *ages* to get mixed font text layout right (and I still haven't done all the bidi stuff yet though I'm pretty confident my newer api will work fine for it).... and surprisingly, I found getting scroll bars right was a huge pain. Maybe that's just me, but between font bugs and scroll bugs, my text edit control, well, sure it worked, but it was a bit of an embarrassment for *years* on linux. Whereas on Windows, of course, it Just Worked from day one thanks to the OS providing it.

Then there's the case of the API and this is one place where we can innovate a little in D, though I've mostly been keeping it actually more-or-less a clone of the web dom api in javascript <http://dpldocs.info/experimental-docs/arsd.minigui.Event.html#details>. But a few fun things like reflecting over a struct to generate accessors that trigger updates automatically:

http://dpldocs.info/this-week-in-d/Blog.Posted_2020_11_02.html#the-user-side

Or dialog boxes and menus and such pulled out of simple function definitions (which I've been doing for websites for... golly 12 years now lol):

http://dpldocs.info/this-week-in-d/Blog.Posted_2023_01_16.html#batch-programs


Which I've been very happy with sprinkling around, even while keeping the core a very traditional oop class set. It is nice when you just do like


---
                @menu("&Edit") {
                        void Envelope_Patterns() {
                                auto e = new Window("Envelope Patterns", 70 * 4, 70 * 4);
                                new EnvelopeChooser(e);
                                e.show();
                        }

                        @accelerator("F1")
                        void Speed_Down() {
                                auto sid = chooser.getSelection()-1;
                                auto sd = editableData.songData(sid, 0);
                                sd[2] = cast(ubyte) --speed; // speed
                                Update();
                        }

                        @accelerator("F2")
                        void Speed_Up() {
                                auto sid = chooser.getSelection()-1;
                                auto sd = editableData.songData(sid, 0);
                                sd[2] = cast(ubyte) ++speed; // speed
                                Update();
                        }

                static string lastMidiFile;
                @menu("Track") {
                        void Import_From_Midi(FileName!(lastMidiFile, ["Midi files\0*.mid;*.midi;*.rmi"]) file) {

             .........
---

and it magically creates the appropriate windows and dialog boxes. Or calling a function:

---
        dialog((NewSpecies ns) {
              // use the ns var here
        });
---

saves a bunch of boilerplate.
March 25, 2023

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

Is there general interest in UI within the D community?

Let's start:

https://github.com/rillki/learn-dlang/tree/master

SDB@79

March 25, 2023

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

I believe that a really good UI toolkit that would allow writing cross-platform, slick-looking, performant applications with nice code may be the killer app that D needs.

March 25, 2023

On Saturday, 25 March 2023 at 13:01:44 UTC, Ogi wrote:

>

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

I believe that a really good UI toolkit that would allow writing cross-platform, slick-looking, performant applications with nice code may be the killer app that D needs.

just use webview2/CEF and Vue.js (or whatever other framework you prefer).
fast, easy, coss platform.
bonus: you have a remote/webui.

there's no need to go for anything else unless you are on a constrained embedded device imho

March 25, 2023

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

Most of the time I've been a backend engineer. However at times I do need to write an app, and usually I go with Gtk.

However, I'm a bit concerned that gtk-d seems .. well, catatonic. DWT also appears to be beyond life support.

We all know Rust has iced-rs, which due to the design of Rust has had to adopt the Elm paradigm.

D, with features that honestly don't need reiterating, could trivially manage OOP, ECS, mixins...

Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

I have a selfish interest in this, hence asking. While spinning a ui toolkit isn't hard, doing it properly can be (accessibility)

I would love to see a UI framework in D, and I came to the same conclusion about gtk-d.

That's why I am trying to build one myself. But as you said, doing one right is hard, especially for me (someone with very few experience in GUI toolkit, and because I chose the hard mode by picking Vulkan + Software rendering as the two backends for the lib).

I like how the Widget API I wrote looks, but without rendering working properly, I can't say my work is very useful.

Application app = new Application("com.dadoum.example", ApplicationFlags.unique);

app.activated ~= (args) {
    writefln!("Activated ! (%-(%s %)) %d %s")(args, args.length, args[1]);
};

Button btn;
Filter filter;

Window w = new Window("Example")
    .set!(Window.size)(400, 800)
   /+.set!(Window.resizeable)(false)+/ [
    new Stack() [
        new Column() [
            new Paragraph() [
                "Use ", new Link("https://github.com/Dadoum/super_forms", "super_.forms"), " !"
            ],
            new Button("click here !").bind!(btn)
        ],
        new Filter()
            .set!(Widget.visible)(false)
            .bind!(filter) [
            new Fixed() [
                new Text("You clicked !")
                    .set!(Child!Fixed.x)(20)
            ]
        ],
    ]
];

w.closed ~= () => app.exit(0);
w.show();
March 25, 2023

On Saturday, 25 March 2023 at 10:03:29 UTC, Ikey Doherty wrote:

>

Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

I'm pretty sure there is some interest. The only problem is that all those UI toolkits are severely outdated and not up to the current standards.

IMHO, the current UI standards are dictated by the frontend frameworks like React or Vue, and also Flutter (and I'm talking about the component-oriented UI).

Rust has another UI library that follows the React functional patterns: https://dioxuslabs.com/

Those functional paradigms are also a great fit for D's dip1000 and the possibility to avoid the GC as all the UI components have a deterministic lifecycle makes it a pretty natural choice for implementing it in D as well.

If only we could have something like Vue.js (where styling and representation are properly defined) and be able to switch backends, say, GTK, QT, HTML, etc...

I bet that would be a huge win for the D community!

March 26, 2023
On 25/03/2023 11:03 PM, Ikey Doherty wrote:
> Is there general interest in UI within the D community? And is there enough to have our own toolkit, or would we be better placed to contribute to the likes of gtk-d?

Absolutely. Many people have tried and done stuff for this.

GUI toolkits are very complex and extremely hard to get right. They are not something you should be doing on a whim with the intent of mass adoption.

Look at Adam's stuff, its pretty successful and long lasting. Yet it doesn't cover all the core requirements to be used by the masses (like UI automation for accessibility).

I've been working in some form or another since 2014 to build a fully D GUI toolkit and during that time I have had some success but mostly failures and an awful lot of iterations.

Right now I'm doing what amounts to a new standard library, -betterC, works with shared libraries including with dll's on Windows by dmd. It is incredible. It should be a very good solid base to build a GUI toolkit upon. It does what I view as everything right. It gets read only memory right with data structures for instance and should be very hard to get its usage wrong wrt. memory safety.

We have attempted in the past to bring us all together with the graphics workgroup, while that has ended, I did utilize an awful lot of the ideas from that into my own work.

The reason I'm going so hard on getting the underlying stuff right is because we've been doing the exact same thing since early in D1 days. Nothing has really stuck. You can see this exact same scenario playing out in Rust too.
March 26, 2023
On Sunday, 26 March 2023 at 00:10:42 UTC, Richard (Rikki) Andrew Cattermole wrote:
> We have attempted in the past to bring us all together with the graphics workgroup, while that has ended, I did utilize an awful lot of the ideas from that into my own work.

Me also in "gamut" library :)
At the times there wasn't a clear way to do fonts, or images, or windows.
well for fonts it's still scattered here and there.
It's probably better to make really good libs for those before doing an UI, a whole UI is a bit above whan a single person could maintain and design.

« First   ‹ Prev
1 2 3 4