How to create GTK+ apps with Glade and D on windows

Russel Winder russel at winder.org.uk
Sat Jun 1 09:16:40 UTC 2019


On Fri, 2019-05-31 at 18:47 +0000, Obsidian Jackal via Digitalmars-d-
learn wrote:
> I'm new to D and want to create GTK+ apps. I have Visual Studio, 
> Glade, the Gtk+ runtime, DMD, and DUB installed. What steps, 
> guides, or advice should I follow to be able to be able to use 
> these tools together to make a sane app?.

Many people ignore Glade and hand code the widget structure of their
applications. For small and simple applications this is fine. I have
done this for Me TV – though I have now switched from D to Rust for
this application so no public D repository, long story. I did though
use XML files (hand written, embedded in the compiled executable using
D's string import) for the menus.

For GFontBrowser (https://github.com/russel/GFontBrowser for now, I may
well move the mainline repository to GitLab due to better integrated
CI/CD) I use Glade and a gtk.Builder instance to read the Glade file –
which is embedded into the compiled executable using string import
rather than being a file on the filestore. This works very well, and
allows all the layout to be done using a layout system rather than
fiddling with lines of code. Deciding how much of the call-backs etc.
to specify in the Glad file and how much to do in the code is something
there seems to be no de facto standard on, so it is down to personal
taste. I choose only to build the widget tree with Glade and do all the
call-backs in code.

I generally start small to get the hang of things and then progress
towards the final application. If the UI has any complications I use
Glade for layout. 

Reading Ron Tarrant's http://gtkdcoding.com/ will almost certainly be
worth it, even if you disagree with some of his codes.

GtkD and GStreamerD (Mike Wey's work) rock – though gtk-rs and
gstreamer-rs are also excellent.


-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20190601/84192dd5/attachment-0001.sig>


More information about the Digitalmars-d-learn mailing list