How do you use D to launch/open a window?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 22 23:53:38 PDT 2016


On Friday, 22 April 2016 at 21:29:29 UTC, anonymousuer wrote:
> On Friday, 22 April 2016 at 21:26:25 UTC, ciechowoj wrote:
>> On Friday, 22 April 2016 at 21:13:31 UTC, anonymousuer wrote:
>>> What code is needed to tell D to open a window? Thank you in 
>>> advance.
>>
>> Could you specify what kind of window do you need?
>
> As in a regular Windows window, for example when you open up IE 
> or a program. The container of the program itself, 
> non-command-line.

The short answer: the same way you do it in C or C++. You just 
need to use bindings to the C or C++ libraries out there. D can 
interface directly with the Win32 API and the bindings for it are 
in DRuntime (the core.sys.windows as Rikki suggested). If all you 
need is to develop on Windows, that's a safe option. If you need 
a complete, cross-platform GUI toolkit, there are D bindings for 
Gtk (GtkD) and SWT (DWT). If you don't need all the bells and 
whistles like tabs, menus, editor panes and the like, then you 
can use SDL or GLFW (see DerelictSDL2 and DerelictGLFW3 for 
bindings), which are oriented toward games and, in GLFW's case, 
OpenGL.


More information about the Digitalmars-d-learn mailing list