www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do you use D to launch/open a window?

reply anonymousuer <3rwety54 fghofdh.com> writes:
What code is needed to tell D to open a window? Thank you in 
advance.
Apr 22 2016
next sibling parent reply ciechowoj <keepitsimplesirius gmail.com> writes:
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?
Apr 22 2016
parent reply anonymousuer <3rwety54 fghofdh.com> writes:
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.
Apr 22 2016
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
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.
Apr 22 2016
prev sibling parent reply Mike Parker <aldacron gmail.com> writes:
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.
Apr 22 2016
parent Jacob Carlborg <doob me.com> writes:
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
Apr 23 2016
prev sibling next sibling parent thedeemon <dlang thedeemon.com> writes:
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(); }
Apr 23 2016
prev sibling next sibling parent Kagamin <spam here.lot> writes:
http://wiki.dlang.org/Libraries_and_Frameworks#GUI_Libraries
Apr 23 2016
prev sibling parent Satoshi <satoshi gshost.eu> writes:
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
Apr 24 2016