www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Gkt4 + Adwaita

reply slawtul <slawek.tuleja gmail.com> writes:
Hi guys,
Was anyone here trying to marry dlang, gtk4 and adwaita lib?
Do you have some examples?

In C++ it's easy - however I would like to use D lang obviously


```
#include <adwaita.h>
#include <gtkmm.h>
#include <ui/include/Window.h>

int main(int argc, char *argv[]) {
   auto app = Gtk::Application::create("my.app");
   
adw_style_manager_set_color_scheme(adw_style_manager_get_default(),
                                      
ADW_COLOR_SCHEME_PREFER_LIGHT);
   return app->make_window_and_run<Window>(argc, argv);
}
```
Feb 23 2023
next sibling parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
On Thursday, 23 February 2023 at 09:51:34 UTC, slawtul wrote:
 Hi guys,
 Was anyone here trying to marry dlang, gtk4 and adwaita lib?
 Do you have some examples?
It already works... well, "kind of". There is GTK4 branch in GtkD (https://gtkd.org) that needs some love. Branch: https://github.com/gtkd-developers/GtkD/tree/gtk4 . With that you can write Gtk4+Adwaita applications in D.
Feb 23 2023
parent reply slawtul <slawek.tuleja gmail.com> writes:
On Thursday, 23 February 2023 at 10:16:35 UTC, Dejan Lekic wrote:
 On Thursday, 23 February 2023 at 09:51:34 UTC, slawtul wrote:
 Hi guys,
 Was anyone here trying to marry dlang, gtk4 and adwaita lib?
 Do you have some examples?
It already works... well, "kind of". There is GTK4 branch in GtkD (https://gtkd.org) that needs some love. Branch: https://github.com/gtkd-developers/GtkD/tree/gtk4 . With that you can write Gtk4+Adwaita applications in D.
Hi thanks, for reply. __that needs some love__ - this statement worries me a litte bit. Anyways, I will try it but if I encounter too many issues - I will stay with c++ unfortunately.
Feb 23 2023
parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
On Thursday, 23 February 2023 at 11:57:17 UTC, slawtul wrote:
 Hi thanks, for reply.

 __that needs some love__ - this statement worries me a litte 
 bit.
 Anyways, I will try it but if I encounter too many issues - I 
 will stay with c++ unfortunately.
Gtk3 branch is quite stable for quite some time. As Ian mentioned, Tilix is based on it for an example - quite popular project built with D and GtkD (stable, Gtk3 branch).
Feb 23 2023
parent slawtul <slawek.tuleja gmail.com> writes:
On Thursday, 23 February 2023 at 12:24:02 UTC, Dejan Lekic wrote:
 On Thursday, 23 February 2023 at 11:57:17 UTC, slawtul wrote:
 Hi thanks, for reply.

 __that needs some love__ - this statement worries me a litte 
 bit.
 Anyways, I will try it but if I encounter too many issues - I 
 will stay with c++ unfortunately.
Gtk3 branch is quite stable for quite some time. As Ian mentioned, Tilix is based on it for an example - quite popular project built with D and GtkD (stable, Gtk3 branch).
I know Tilix - I even use it everyday. It's a pity the project is less and less maintained.
Feb 23 2023
prev sibling next sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
On Thursday, 23 February 2023 at 09:51:34 UTC, slawtul wrote:
 Hi guys,
 Was anyone here trying to marry dlang, gtk4 and adwaita lib?
 Do you have some examples?
Here is an example with Gtk3: https://imgur.com/nXcI7E9.png ![DIDE 0.1.0](https://imgur.com/nXcI7E9.png "DIDE 0.1.0")
Feb 23 2023
prev sibling parent Iain Buclaw <ibuclaw gdcproject.org> writes:
On Thursday, 23 February 2023 at 09:51:34 UTC, slawtul wrote:
 Hi guys,
 Was anyone here trying to marry dlang, gtk4 and adwaita lib?
 Do you have some examples?

 In C++ it's easy - however I would like to use D lang obviously
I had a quick look at Tilix, but it's still using GTK3 it seems. https://github.com/gnunn1/tilix
Feb 23 2023