www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - simple gui on windows 11

reply Lars Johansson <lasse 11dim.se> writes:
Hej, I got a problem.
While trying to  learn D (I am on Windows 11)
i like to build a simple window with some textboxes pushbuttons 
etc.

Raylib is way to complex for this.

arsd.minigui won't compile link gives me I got lld-link: error: 
/manifestdependency: is not allowed in .drectve
both with ldc and dmd.

GTK-D - Error Unresolvable dependencies to package gtk-d:

import core.sys.windows.windows;
The inputbox does not have a box.
lld-link: error: undefined symbol: MessageBoxW
It looks like windows do not have a messageBox at all.

Can someone advice a working simple GUI for Windows 11?
Jan 23
next sibling parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
On 24/01/2026 4:00 AM, Lars Johansson wrote:
 import core.sys.windows.windows; The inputbox does not have a box. lld- 
 link: error: undefined symbol: MessageBoxW It looks like windows do not 
 have a messageBox at all.
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxw Library User32.lib DLL User32.dll Slap on the import library user32.lib on your compiler command and it should link.
Jan 23
parent Lars Johansson <lasse 11dim.se> writes:
On Friday, 23 January 2026 at 15:05:56 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 On 24/01/2026 4:00 AM, Lars Johansson wrote:
 import core.sys.windows.windows; The inputbox does not have a 
 box. lld- link: error: undefined symbol: MessageBoxW It looks 
 like windows do not have a messageBox at all.
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messageboxw Library User32.lib DLL User32.dll Slap on the import library user32.lib on your compiler command and it should link.
Hi thank you I will use this when I'm better at D. I try to be confident with the simple things like if,dowhile etc first, only using HUB run. The compiler and linker comes a bit later. I will surly test this the comming weeks, being able to map into MS systems are important, but for now a simple crossplatform GUI is all I need. I will start with dlangui.
Jan 23
prev sibling next sibling parent reply Serg Gini <kornburn yandex.ru> writes:
On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson wrote:
 Hej, I got a problem.
 While trying to  learn D (I am on Windows 11)
 i like to build a simple window with some textboxes pushbuttons 
 etc.

 Can someone advice a working simple GUI for Windows 11?
Hey there! "for sure" Here we go (Higher in the list - higher my suggestion to check): https://code.dlang.org/packages/dfl - Windows specific library https://code.dlang.org/packages/dlangui - cross platform, including windows https://code.dlang.org/packages/guino - cross platform based on webview https://code.dlang.org/packages/gid - new better GTK bindings https://code.dlang.org/packages/dqt - if you prefer Qt https://code.dlang.org/packages/fluid - declarative UI https://code.dlang.org/packages/microui-d - something very simple
Jan 23
parent reply Lars Johansson <lasse 11dim.se> writes:
On Friday, 23 January 2026 at 15:27:42 UTC, Serg Gini wrote:
 On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson 
 wrote:
 [...]
Hey there! "for sure" Here we go (Higher in the list - higher my suggestion to check):
Thank you for all alternatives I will start with Dlangui, as it seems to be a good start.
Jan 23
parent reply Lars Johansson <lasse 11dim.se> writes:
On Saturday, 24 January 2026 at 05:42:05 UTC, Lars Johansson 
wrote:
 On Friday, 23 January 2026 at 15:27:42 UTC, Serg Gini wrote:
 On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson 
 wrote:
 [...]
Hey there! "for sure" Here we go (Higher in the list - higher my suggestion to check):
 Thank you for all alternatives I will start with Dlangui, as it 
 seems to be a good start.
After trying almost all alternatives I finally made Dlangui work. First I got dlangui cyclic dependecy error. I got the same for fluid. I then realised you should not name the root dir same as the product. I renamed dlangui to mydlangui and voila! I have not seen any warning about this, but it might just be me not reading all the fine prints. Anyway I have a working gui. I play with it, and try to figure out my next step in D. p.s. Clude warned me, Gui in Windows with Dlang can be tricky.
Jan 24
next sibling parent reply PeterHoo <peterhu.peterhu outlook.com> writes:
On Saturday, 24 January 2026 at 13:27:55 UTC, Lars Johansson 
wrote:
 On Saturday, 24 January 2026 at 05:42:05 UTC, Lars Johansson 
 wrote:
 On Friday, 23 January 2026 at 15:27:42 UTC, Serg Gini wrote:
 On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson 
 wrote:
 [...]
Hey there! "for sure" Here we go (Higher in the list - higher my suggestion to check):
 Thank you for all alternatives I will start with Dlangui, as 
 it seems to be a good start.
After trying almost all alternatives I finally made Dlangui work. First I got dlangui cyclic dependecy error. I got the same for fluid. I then realised you should not name the root dir same as the product. I renamed dlangui to mydlangui and voila! I have not seen any warning about this, but it might just be me not reading all the fine prints. Anyway I have a working gui. I play with it, and try to figure out my next step in D. p.s. Clude warned me, Gui in Windows with Dlang can be tricky.
On Windows DFL https://code.dlang.org/packages/dfl is great.And it is execellent with its GUI designer (Drag & drop components) Entice http://www.dprogramming.com/entice.php dub fetch dfl and dub build dfl -a=x86_64 works smoothly ever since. And interop with win32 api within DFL is as easy as if win32 api is integrated. ``` /* Generated by Entice Designer Entice Designer written by Christopher E. Miller www.dprogramming.com/entice.php */ import dfl.all; import core.sys.windows.windows; import std.format; import std.conv; enum info="¡Hola Mundo!Γειά σου Κόσμε!Привет, мир!こんにちは世界!你好世界!नमस्ते दुनिया!👋🌎!"d; class MyForm: dfl.form.Form { // Do not modify or move this block of variables. //~Entice Designer variables begin here. dfl.label.Label label1; dfl.button.Button btnGet; //~Entice Designer variables end here. this() { initializeMyForm(); // Other MyForm initialization code here. btnGet.click~=(Object sender,EventArgs ea) { label1.text=format("नमस्ते दुनिया!👋🌎!Width: %d Height: %d", GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)); PlaySound("hellowin.wav",null,SND_FILENAME|SND_ASYNC); //DFL has Graphics library inside,just to play around with win32 API here HDC hdc=GetDC(handle); PAINTSTRUCT ps; RECT rect={20,120,500,160}; SetTextColor(hdc,RGB(0,0,255)); SetBkMode(hdc,TRANSPARENT); DrawText(hdc,info.to!wstring.ptr,-1,&rect,DT_WORDBREAK|DT_CENTER|DT_VCENTER); //DrawTextW(hdc,"दुनिया!👋🌎!",-1,&rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER); // Create an array of TRIVERTEX structures that describe // positional and color values for each vertex. TRIVERTEX[3] vertex; vertex[0].x = 250; vertex[0].y = 150; vertex[0].Red = 0xff00; vertex[0].Green = 0x8000; vertex[0].Blue = 0x0000; vertex[0].Alpha = 0x0000; vertex[1].x = 100; vertex[1].y = 300; vertex[1].Red = 0x9000; vertex[1].Green = 0x0000; vertex[1].Blue = 0x9000; vertex[1].Alpha = 0x0000; vertex[2].x = 400; vertex[2].y = 300; vertex[2].Red = 0x9000; vertex[2].Green = 0x0000; vertex[2].Blue = 0x9000; vertex[2].Alpha = 0x0000; //Create a gradient_triangle structure taht //references the trivertext vertices GRADIENT_TRIANGLE gTriangle; gTriangle.Vertex1=0; gTriangle.Vertex2=1; gTriangle.Vertex3=2; GradientFill(hdc,cast(TRIVERTEX*)vertex,3,&gTriangle,1,GRADIENT_FILL_TRIANGLE); EndPaint(handle,&ps); ReleaseDC(handle,hdc); }; } private void initializeMyForm() { // Do not manually modify this function. //~Entice Designer 0.8.5.02 code begins here. //~DFL Form text = "My Form"; clientSize = dfl.all.Size(512, 342); //~DFL dfl.label.Label=label1 label1 = new dfl.label.Label(); label1.name = "label1"; label1.backColor = dfl.all.SystemColors.controlLight; label1.font = new dfl.all.Font("Microsoft YaHei UI", 10f, dfl.all.FontStyle.BOLD); label1.foreColor = dfl.all.Color(255, 128, 0); label1.borderStyle = dfl.all.BorderStyle.FIXED_3D; label1.textAlign = dfl.all.ContentAlignment.MIDDLE_CENTER; label1.bounds = dfl.all.Rect(16, 48, 448, 32); label1.parent = this; //~DFL dfl.button.Button=btnGet btnGet = new dfl.button.Button(); btnGet.name = "btnDraw"; btnGet.text = "(&D)raw"; btnGet.bounds = dfl.all.Rect(16, 16, 104, 24); btnGet.parent = this; //~Entice Designer 0.8.5.02 code ends here. } } int main() { int result = 0; try { Application.enableVisualStyles(); // Other application initialization code here. Application.run(new MyForm()); } catch(DflThrowable o) { msgBox(o.toString(), "Fatal Error", MsgBoxButtons.OK, MsgBoxIcon.ERROR); result = 1; } return result; } ```
Jan 24
parent Lars Johansson <lasse 11dim.se> writes:
On Sunday, 25 January 2026 at 01:11:56 UTC, PeterHoo wrote:
 
 ```
Hi thank you, this looks very interesting and something I will give a shot later on.
Jan 24
prev sibling parent Sergey <kornburn yandex.ru> writes:
On Saturday, 24 January 2026 at 13:27:55 UTC, Lars Johansson 
wrote:
 After trying almost all alternatives I finally made Dlangui 
 work.
 First I got dlangui cyclic dependecy error. I got the same for 
 fluid. I then realised you should not name the root dir same as 
 the product. I renamed dlangui to mydlangui and voila!
 I have not seen any warning about this, but it might just be me 
 not reading all the fine prints.
 Anyway I have a working gui. I play with it, and try to figure 
 out my next step in D.

 p.s. Clude warned me, Gui in Windows with Dlang can be tricky.
haha D is not for weak :) you need to be brave to fix compiler bugs if you want to use D :) Nice that you found the way to make it working
Jan 25
prev sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson wrote:
 arsd.minigui won't compile link gives me I got lld-link: error: 
 /manifestdependency: is not allowed in .drectve
That looks like an ancient linker, lld-link added support for that in version 14, released about four years ago. ...... the latest dmd still has lld-link version 9.0. well there's your problem lol. the opend release comes with a newer linker: https://github.com/opendlang/opend/releases/download/CI/opend-latest-windows-x64.7z Or with your existing compiler, try compiling your minigui program with the argument to dmd `-version=minigui_no_manifest` and it should opt out of that. You'll lose some of the Windows theming features but they're non-essential.
Jan 23
parent Lars Johansson <lasse 11dim.se> writes:
On Friday, 23 January 2026 at 16:26:34 UTC, Adam D. Ruppe wrote:
 On Friday, 23 January 2026 at 15:00:53 UTC, Lars Johansson 
 wrote:
 arsd.minigui won't compile link gives me I got lld-link: 
 error: /manifestdependency: is not allowed in .drectve
That looks like an ancient linker, lld-link added support for that in version 14, released about four years ago. ...... the latest dmd still has lld-link version 9.0. well there's your problem lol. the opend release comes with a newer linker: https://github.com/opendlang/opend/releases/download/CI/opend-latest-windows-x64.7z Or with your existing compiler, try compiling your minigui program with the argument to dmd `-version=minigui_no_manifest` and it should opt out of that. You'll lose some of the Windows theming features but they're non-essential.
Thank you for your suggestion, please see my answer to Ricki Cattermole. I will try this a bit later. And stay with DMD/DUB for now. I need to take my baby steps.
Jan 23