Is UI interesting for us?

Dadoum dadoum at protonmail.com
Sat Mar 25 19:29:19 UTC 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.

```d
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();
```


More information about the Digitalmars-d mailing list