Thread overview
How do you use D to launch/open a window?
Apr 22, 2016
anonymousuer
Apr 22, 2016
ciechowoj
Apr 22, 2016
anonymousuer
Apr 23, 2016
rikki cattermole
Apr 23, 2016
Mike Parker
Apr 23, 2016
Jacob Carlborg
Apr 23, 2016
thedeemon
Apr 23, 2016
Kagamin
Apr 24, 2016
Satoshi
April 22, 2016
What code is needed to tell D to open a window? Thank you in advance.
April 22, 2016
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?
April 22, 2016
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.
April 23, 2016
On 23/04/2016 9:29 AM, 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.

So a GUI window?
If so I am working on a library for that for Phobos.
Only problem is, its a long way off. Although Windows support is more or less done.

https://github.com/rikkimax/alphaPhobos/tree/master/source/std/experimental/ui/window

Otherwise you're stuck with c libraries such as SDL.
April 23, 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.
April 23, 2016
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.

import dlangui;
mixin APP_ENTRY_POINT;

extern (C) int UIAppMain(string[] args) {
    Window window = Platform.instance.createWindow("Window caption", null);
    window.mainWidget = parseML(q{
        TextWidget {text: "hi!"}
    });

    window.show();
    return Platform.instance.enterMessageLoop();
}

April 23, 2016
On 2016-04-23 08:53, Mike Parker wrote:

> If you need a complete, cross-platform
> GUI toolkit, there are D bindings for Gtk (GtkD) and SWT (DWT).

Technically DWT is not bindings to SWT. It's the full source completely translated to D.

-- 
/Jacob Carlborg
April 23, 2016
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
April 24, 2016
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.

You can choose between existing libraries or wrappers for GUI implementation like:
DlangUI, Qt, ..., (or my new GUI framework called Rikarin what will be avaiable soon).

If you want just create window for e.g. OpenGL context you can use WinAPI CreateWindow or wrappers like SDL or GLFW