Want to start a graphical Hello world.

Matthias Klumpp mak at debian.org
Sun Jan 21 07:48:20 UTC 2018


On Sunday, 21 January 2018 at 04:16:10 UTC, MHE wrote:
> [...]
> For this i have made a folder named GIT in the linux directory 
> /usr/local/GIT
> And Gitcloned in the GIT folder :
> git clone https://github.com/nomad-software/x11
> git clone https://github.com/nomad-software/tcltk.git
> The clones are now in /usr/local/GIT/

Hmm, but you are using GtkD in your example... It looks like you 
compiled the wrong code.
What you actually want is GtkD from 
https://github.com/gtkd-developers/GtkD or installed from the 
Debian repositories (in case you want to use LDC) via `sudo apt 
install libgtkd-3-dev`

> When i start the upper code in a cmd the result is as follows :
> ___________________________________________________________________
> $ dmd hw_graphical.d
> hw_graphical.d(1): Error: module MainWindow is in file 
> 'gtk/MainWindow.d' which cannot be read
> import path[0] = /usr/include/dmd/phobos
> import path[1] = /usr/include/dmd/druntime/import
>
>
> What must be done that the code make a graphical window ?

If you want to use GtkD and achieve a quick result, you might 
want to use the Dub package manager.
GtkD also has a few demo applications that show you how to use it 
with dub, take a look at
https://github.com/gtkd-developers/GtkD/tree/master/demos/gtk

> I want to make the D programming tkd module ready for GUI 
> programming.
> Need a step by step advice for BEGINNERS in D programming.

tkd is a project different from GtkD (which your example above is 
using). For "modern" UI that integrates well with GNOME, you will 
highly likely want to use GtkD. Tcl/Tk is of course an option as 
well, but the D bindings look less complete and well maintained.
In case you want to use Tk, you will need to change your code to 
actually use it, instead of GTK+ though ;-)

> Any Internetlink for step by step instructions how to arrange D 
> and TK would be helpful !

I can't help with Tk, but for GTK+ a quick Google search found 
https://sites.google.com/site/gtkdtutorial/ - this tutorial is 
rather old, but it might be useful as a reference.

This experience report by Gerald Nunn might also be an 
interesting read for you: 
https://gexperts.com/wp/learning-d-and-gtk/

Cheers,
     Matthias





More information about the Digitalmars-d mailing list