www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - How to build program with DWT2 and DMD2?

reply "JohnnyK" <johnnykinsey comcast.net> writes:
Hi all,
   Sorry for what may seem like a simple and obvious question to 
most DWT users.  First I would like to say that I have absolutely 
no experience with SWT in any form.  Second I know nothing of 
Eclipse other than that is what happens when the moon is directly 
between the earth and the sun.  I would like to know in a few 
simple steps or examples how to build a hello world or some other 
trivial GUI application with DWT.  Following the instructions I 
was able to build the Snippets but that does not really tell you 
how to start a DWT project from scratch.  I would really like to 
get some steps on how to start a DWT project from a project 
folder somewhere and compile it.  So far the snippets show off 
the abilities of the library but they are not a tutorial and 
don't help us noobs.  The snippets would be good if they had HOW 
to comments or other documentation that explains how to get this 
done.  Also it would be nice if someone could share a typical 
directory layout of their DWT programming environment and what 
tools(aka IDE) they use.  I am finding this whole DWT thing to be 
a really daunting task without some kind of tutoring.  I have 
found DWT to be really hard to get started with.  I do like the 
fact that one can make a single executable that can be copied and 
executed without the need to install a huge API or additional 
baggage files before the executable will run.
Jul 31 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-07-31 15:47, JohnnyK wrote:
 Hi all,
    Sorry for what may seem like a simple and obvious question to most
 DWT users.  First I would like to say that I have absolutely no
 experience with SWT in any form.  Second I know nothing of Eclipse other
 than that is what happens when the moon is directly between the earth
 and the sun.  I would like to know in a few simple steps or examples how
 to build a hello world or some other trivial GUI application with DWT.
 Following the instructions I was able to build the Snippets but that
 does not really tell you how to start a DWT project from scratch.  I
 would really like to get some steps on how to start a DWT project from a
 project folder somewhere and compile it.  So far the snippets show off
 the abilities of the library but they are not a tutorial and don't help
 us noobs.  The snippets would be good if they had HOW to comments or
 other documentation that explains how to get this done.  Also it would
 be nice if someone could share a typical directory layout of their DWT
 programming environment and what tools(aka IDE) they use.  I am finding
 this whole DWT thing to be a really daunting task without some kind of
 tutoring.  I have found DWT to be really hard to get started with.  I do
 like the fact that one can make a single executable that can be copied
 and executed without the need to install a huge API or additional
 baggage files before the executable will run.
Hello World using DWT would look something like this: module main; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; void main () { auto display = new Display; auto shell = new Shell; shell.open(); while (!shell.isDisposed) if (!display.readAndDispatch()) display.sleep(); display.dispose(); } I would recommend compiling it with rdmd (supplied with dmd) : rdmd main.d -I/path/to/dwt For learning how to use DWT I would recommend all the tutorials out there for SWT. They are similar enough making it easy to port for SWT (Java) code to DWT (D). -- /Jacob Carlborg
Aug 02 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Friday, 2 August 2013 at 11:28:15 UTC, Jacob Carlborg wrote:
 On 2013-07-31 15:47, JohnnyK wrote:
 Hi all,
   Sorry for what may seem like a simple and obvious question 
 to most
 DWT users.  First I would like to say that I have absolutely no
 experience with SWT in any form.  Second I know nothing of 
 Eclipse other
 than that is what happens when the moon is directly between 
 the earth
 and the sun.  I would like to know in a few simple steps or 
 examples how
 to build a hello world or some other trivial GUI application 
 with DWT.
 Following the instructions I was able to build the Snippets 
 but that
 does not really tell you how to start a DWT project from 
 scratch.  I
 would really like to get some steps on how to start a DWT 
 project from a
 project folder somewhere and compile it.  So far the snippets 
 show off
 the abilities of the library but they are not a tutorial and 
 don't help
 us noobs.  The snippets would be good if they had HOW to 
 comments or
 other documentation that explains how to get this done.  Also 
 it would
 be nice if someone could share a typical directory layout of 
 their DWT
 programming environment and what tools(aka IDE) they use.  I 
 am finding
 this whole DWT thing to be a really daunting task without some 
 kind of
 tutoring.  I have found DWT to be really hard to get started 
 with.  I do
 like the fact that one can make a single executable that can 
 be copied
 and executed without the need to install a huge API or 
 additional
 baggage files before the executable will run.
Hello World using DWT would look something like this: module main; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; void main () { auto display = new Display; auto shell = new Shell; shell.open(); while (!shell.isDisposed) if (!display.readAndDispatch()) display.sleep(); display.dispose(); } I would recommend compiling it with rdmd (supplied with dmd) : rdmd main.d -I/path/to/dwt For learning how to use DWT I would recommend all the tutorials out there for SWT. They are similar enough making it easy to port for SWT (Java) code to DWT (D).
Thanks Jacob for the response but that did not work :-( Below is what I get when I compile your hello world example above. C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld>rdmd hello.d -IC:\GITClones\dwt hello.d(3): Error: module Display is in file 'org\eclipse\swt\widgets\Display.d' which cannot be read import path[0] = . import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import Failed: "dmd" "-v" "-o-" "hello.d" "-I."
Aug 02 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-02 19:50, JohnnyK wrote:

 Thanks Jacob for the response but that did not work :-(  Below is what I
 get when I compile your hello world example above.


 C:\Users\<myusername>\Documents\My
 Projects\Programming\DStuff\dwthelloworld>rdmd hello.d -IC:\GITClones\dwt
 hello.d(3): Error: module Display is in file
 'org\eclipse\swt\widgets\Display.d'
   which cannot be read
 import path[0] = .
 import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
 import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
 Failed: "dmd" "-v" "-o-" "hello.d" "-I."
If you have cloned the git repository into C:\GITClones\dwt you should compile it like this: rdmd hello.d -IC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src -IC:\GITClones\dwt\base\src Also make sure you cloned the repository using "git clone --recursive". This will clone the submodules as well. -- /Jacob Carlborg
Aug 06 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Tuesday, 6 August 2013 at 11:32:44 UTC, Jacob Carlborg wrote:
 On 2013-08-02 19:50, JohnnyK wrote:

 If you have cloned the git repository into C:\GITClones\dwt you 
 should compile it like this:

 rdmd hello.d 
 -IC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src 
 -IC:\GITClones\dwt\base\src

 Also make sure you cloned the repository using "git clone 
 --recursive". This will clone the submodules as well.
yeah that did not work for me either. As you can see below it is the same as before. C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld>rdmd he llo.d -IC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src -IC:\GITClones\dwt\ base\src hello.d(3): Error: module Display is in file 'org\eclipse\swt\widgets\Display.d' which cannot be read import path[0] = . import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import Failed: "dmd" "-v" "-o-" "hello.d" "-I." C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld> The Display.d is at C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\widgets on my windows box. All I know is that the snippets do compile so I am very confused as to why this will not. GIT does not work directly here at work. The company I work for uses a proxy server so I had to put it through a NTLMaps program to handle the companies proxy authentication. So when I tried to use recursive that did not work because to make it work I had to use HTTP: instead of GIT: on the url but the sub-modules tried to use GIT: as the protocol in the URL. I then cloned the sub-modules individually so that I could get the snippets to compile which I did and most of them compiled. The only ones that did not compile are those looking for the Browser.d file and that use some lib called derelict whatever that is. Honestly I see GIT to be a big stumbling block for those of us that just want to use your wares. If I was contributing then sure I can see where GIT would help but all I want to do is download a and use the library for now. Anyway I appreciate your help but I may need to use some other widget toolkit if I can find one. However right now the only real toolkit that comes close to my requirements is DWT but if I cannot get it to compile code outside it's development folders I don't think it will be of much practical use to me. My Widget Tool Kit Needs: Executable File size no larger than 5MB (minus resource/baggage files) would like less than 1MB if possible. Must compile and run everywhere DMD does (mainly Windows & Linux). Is self contained in a file or 2 and does not need a separate install package. Can be copied to a directory and run with out modifying OS configurations or touching other files that are not part of the application. Must look like or be native interface. Must have a DateTime, Treeview, and Table/Grid widgets. These don't need data binding but that would be nice. Would like to have drag-n-drop plus clipboard support as appropriate for the OS. As you can see above most of these needs can be accomplished by DWT which is evident by the snippets but I just need to be able to compile from everywhere. Maybe it is my configuration here. If I get a chance when I get home tonight I will try to compile this on my Linux box and let you know. I have a virtual XP machine I can try as well. I will let you know and again thanks for your help and patients.
Aug 06 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-06 16:49, JohnnyK wrote:

 yeah that did not work for me either.  As you can see below it is the
 same as before.

 The Display.d is at
 C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\widgets
 on my windows box.
Oh, I know what the problem is now. You need to pass the -I flags before the hello.d file. RDMD works like this: all flags passed before the D file will be passed to the compiler. All flags passed after the D file will be passed to the compiled application when it's run.
 All I know is that the snippets do compile so I am very confused as to
 why this will not.  GIT does not work directly here at work.  The
 company I work for uses a proxy server so I had to put it through a
 NTLMaps program to handle the companies proxy authentication.  So when I
 tried to use recursive that did not work because to make it work I had
 to use HTTP: instead of GIT: on the url but the sub-modules tried to use
 GIT: as the protocol in the URL.  I then cloned the sub-modules
 individually so that I could get the snippets to compile which I did and
 most of them compiled.  The only ones that did not compile are those
 looking for the Browser.d file and that use some lib called derelict
 whatever that is.
 Honestly I see GIT to be a big stumbling block for those of us that just
 want to use your wares.  If I was contributing then sure I can see where
 GIT would help but all I want to do is download a and use the library
 for now.  Anyway I appreciate your help but I may need to use some other
 widget toolkit if I can find one.  However right now the only real
 toolkit that comes close to my requirements is DWT but if I cannot get
 it to compile code outside it's development folders I don't think it
 will be of much practical use to me.
All projects on Github have a link to a zip download, for DWT it's: https://github.com/d-widget-toolkit/dwt/archive/master.zip I have no idea if that will include the submodules or not. Ideally we will one day have a package manager for D making this much easier. -- /Jacob Carlborg
Aug 07 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-07 11:48, Jacob Carlborg wrote:

 RDMD works like this: all flags passed before the D file will be passed
 to the compiler. All flags passed after the D file will be passed to the
 compiled application when it's run.
You can also pass --build-only if you don't want to run the resulting binary. -- /Jacob Carlborg
Aug 07 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Wednesday, 7 August 2013 at 09:49:50 UTC, Jacob Carlborg wrote:
 On 2013-08-07 11:48, Jacob Carlborg wrote:

 RDMD works like this: all flags passed before the D file will 
 be passed
 to the compiler. All flags passed after the D file will be 
 passed to the
 compiled application when it's run.
You can also pass --build-only if you don't want to run the resulting binary.
Well now I get these errors C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld>rdmd -I C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src -IC:\GITClones\dwt\base\src hello.d C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_ar.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_ar.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_cs.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_cs.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_da.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_da.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_de.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_de.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_el.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_el.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_es.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_es.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_fi.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_fi.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_fr.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_fr.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_hu.properties C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co mpatibility.d(332): Error: template instance java.lang.util.getImportData!("org. eclipse.swt.internal.SWTMessages_hu.properties") error instantiating C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath switch to im port text file org.eclipse.swt.internal.SWTMessages_it.properties Failed: "dmd" "-IC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src" "-IC:\GIT Clones\dwt\base\src" "-v" "-o-" "hello.d" "-I." C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld> BTW I got git to work with NTLMaps also there is a separate zip file for each module no issue. Sorry I did not get a chance to try this on my Linux box yesterday. BTW I did copy the hello.d file over to the snippets folder and used the same command line that compiles regular snippets to compile this and it worked just fine. So basically I put hello.d in the C:\GITClones\dwt\org.eclipse.swt.snippets\src\org\eclipse\swt\snippets and used the following command to compile it rdmd build swtsnippets[hello] from the C:\GITClones\dwt directory. This built a executable called Swthello.exe in C:\GITClones\dwt\bin directory. So I know the code compiles and runs without issue. I just don't know the magic that build.d is performing so that I can replicate it outside the dwt directory structures. I read through build.d and it seems kind of over complicating but I guess the complexity is obviously needed because I can't seem to get it to compile any other way. The rsp file that build.d uses has 30 lines that it sends to dmd. Poor dmd... ;) Oh well maybe will just need more time working with dmd and it's toolset before I take on something this big. Rome wasn't built in a day but then again the Romans did not have D with build.d either.
Aug 07 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-07 16:04, JohnnyK wrote:

 Well now I get these errors

 C:\Users\<myusername>\Documents\My
 Projects\Programming\DStuff\dwthelloworld>rdmd -I
 C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src
 -IC:\GITClones\dwt\base\src
   hello.d
 C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need -Jpath
 switch to im
 port text file org.eclipse.swt.internal.SWTMessages.properties
 C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co
Forgot about the -J flag. Add: -JC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\res To the result of the flags (before hello.d). -- /Jacob Carlborg
Aug 07 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Wednesday, 7 August 2013 at 15:42:32 UTC, Jacob Carlborg wrote:
 On 2013-08-07 16:04, JohnnyK wrote:

 Well now I get these errors

 C:\Users\<myusername>\Documents\My
 Projects\Programming\DStuff\dwthelloworld>rdmd -I
 C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src
 -IC:\GITClones\dwt\base\src
  hello.d
 C:\GITClones\dwt\base\src\java\lang\util.d(595): Error: need 
 -Jpath
 switch to im
 port text file org.eclipse.swt.internal.SWTMessages.properties
 C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Co
Forgot about the -J flag. Add: -JC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\res To the result of the flags (before hello.d).
Still no love for me from DWT :( C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld>rdmd -I C:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\src -IC:\GITClones\dwt\base\src -JC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\res hello.d OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html olepro32.lib Warning 2: File Not Found olepro32.lib oleacc.lib Warning 2: File Not Found oleacc.lib usp10.lib Warning 2: File Not Found usp10.lib msimg32.lib Warning 2: File Not Found msimg32.lib opengl32.lib Warning 2: File Not Found opengl32.lib shlwapi.lib Warning 2: File Not Found shlwapi.lib dwt-base.lib Warning 2: File Not Found dwt-base.lib C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _CreateStdAccessibleObject 16 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _LresultFromObject 12 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _TransparentBlt 44 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _AlphaBlend 44 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptFreeCache 4 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptCPtoX 36 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptTextOut 56 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptJustify 24 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptLayout 16 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptGetLogicalWidths 28 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptBreak 16 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptShape 40 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptGetFontProperties 12 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptGetCMap 24 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptPlace 36 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptStringFree 4 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptStringOut 32 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptStringAnalyse 52 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptApplyDigitSubstitution 12 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptRecordDigitSubstitution 8 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptItemize 28 C:\Users\<myusername>\AppData\Local\Temp\.rdmd\rdmd-hello.d-096034CD5310F89CCCDCE879 E0E32294\objs\hello.obj(hello) Error 42: Symbol Undefined _ScriptGetProperties 8 --- errorlevel 22 C:\Users\<myusername>\Documents\My Projects\Programming\DStuff\dwthelloworld> It looks to be unable to find the static libs now. How do people use this library? Do they work in the dwt folder and just use that build.d file to compile with? Again I would like to know the layout of a typical programmers workstation that uses DWT for the GUI parts of their application? Is anyone using DWT today? I appreciate all your help Jacob but I didn't think it would be this hard or take this long just to build and compile a program that just shows a window. Has anyone ever tried to install D and DWT on a virgin machine then start a clean project to build a simple application like this before? Maybe there is something I need to add to my PATH environment variable or something like that which would make this easier? The command line is longer than the code I am trying to compile at this point.
Aug 07 2013
parent reply Druzhinin Alexandr <news digitalmars.com> writes:
On 08.08.2013 00:03, JohnnyK wrote:>
 It looks to be unable to find the static libs now.  How do people use
 this library?  Do they work in the dwt folder and just use that build.d
 file to compile with?  Again I would like to know the layout of a
 typical programmers workstation that uses DWT for the GUI parts of their
 application?  Is anyone using DWT today?
 I appreciate all your help Jacob but I didn't think it would be this
 hard or take this long just to build and compile a program that just
 shows a window.  Has anyone ever tried to install D and DWT on a virgin
 machine then start a clean project to build a simple application like
 this before?  Maybe there is something I need to add to my PATH
 environment variable or something like that which would make this
 easier?  The command line is longer than the code I am trying to compile
 at this point.
DWT works fine for me at least. Try the following: cd /path/to/dwt dmd build.d build base del .\imp\java\lang\util.di copy .\base\src\java\lang\util.d .\imp\java\lang\ build swt del .\imp\org\eclipse\swt\internal\Library.di copy .\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Library.d .\imp\org\eclipse\swt\internal then build your app using (win32): dmd -Ipath\to\dwt\imp -Jpath\to\dwt\org.eclipse.swt.win32.win32.x86\res path\to\dwt\lib\org.eclipse.swt.win32.win32.x86.lib path\to\dwt\lib\olepro32.lib path\to\dwt\lib\oleacc.lib path\to\dwt\lib\usp10.lib path\to\dwt\lib\msimg32.lib path\to\dwt\lib\opengl32.lib path\to\dwt\lib\shlwapi.lib path\to\dwt\lib\dwt-base.lib yourapp.d may be you'll need to fix the paths I wrote - I think it won't be hard
Aug 07 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Wednesday, 7 August 2013 at 18:55:53 UTC, Druzhinin Alexandr 
wrote:
 On 08.08.2013 00:03, JohnnyK wrote:>
 It looks to be unable to find the static libs now.  How do
people use
 this library?  Do they work in the dwt folder and just use
that build.d
 file to compile with?  Again I would like to know the layout
of a
 typical programmers workstation that uses DWT for the GUI
parts of their
 application?  Is anyone using DWT today?
 I appreciate all your help Jacob but I didn't think it would
be this
 hard or take this long just to build and compile a program
that just
 shows a window.  Has anyone ever tried to install D and DWT
on a virgin
 machine then start a clean project to build a simple
application like
 this before?  Maybe there is something I need to add to my
PATH
 environment variable or something like that which would make
this
 easier?  The command line is longer than the code I am trying
to compile
 at this point.
DWT works fine for me at least. Try the following: cd /path/to/dwt dmd build.d build base del .\imp\java\lang\util.di copy .\base\src\java\lang\util.d .\imp\java\lang\ build swt del .\imp\org\eclipse\swt\internal\Library.di copy .\org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\internal\Library.d .\imp\org\eclipse\swt\internal then build your app using (win32): dmd -Ipath\to\dwt\imp -Jpath\to\dwt\org.eclipse.swt.win32.win32.x86\res path\to\dwt\lib\org.eclipse.swt.win32.win32.x86.lib path\to\dwt\lib\olepro32.lib path\to\dwt\lib\oleacc.lib path\to\dwt\lib\usp10.lib path\to\dwt\lib\msimg32.lib path\to\dwt\lib\opengl32.lib path\to\dwt\lib\shlwapi.lib path\to\dwt\lib\dwt-base.lib yourapp.d may be you'll need to fix the paths I wrote - I think it won't be hard
I know DWT works because I am able to compile the base and I am able to compile the snippets as specified by the DWT Author's instructions. Anyway thanks for the information but these are no where close to the instructions that the author of DWT said to follow. I am a bit concerned about deleting and copying files around because I would like to be able to perform painless upgrades of DWT without trying to remember "Oh yeah I copied utils.d over here." Or worse I go to perform these copies and those files are no longer called this or are just missing then what would I do? Because I could not get the authors instructions to work tells me the author needs to be aware and needs to either fix the instructions or fix the layout of the distribution. Maybe some part of the Base did not compile or something like that. I have no idea it could be anything when you are trying to compile code on another machine from the one that the code was developed on. I wish DWT was offered as a binary distro instead of source code. Either way I would rather to always follow the instructions given to me by the author. Now what I may do is try compiling with dmd directly instead of using rdmd, I was just not sure what libraries are required is all.
Aug 08 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Thursday, 8 August 2013 at 13:07:15 UTC, JohnnyK wrote:
Ok problem resolved.  I can now compile DWT applications from 
another directory structure outside of the dwt distribution 
directories.  Below is the commandline that I used and I did not 
have to delete or copy or follow any other compile instructions 
other than what the Author has in his Readme file.

dmd -IC:\GITClones\dwt\imp\ 
-JC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\res\ -m32 -op 
-od.\obj\ -of.\bin\hello.exe .\hello.d -L/SUBSYSTEM:WINDOWS:4.0 
-L+advapi32.lib -L+comctl32.lib -L+comdlg32.lib -L+gdi32.lib 
-L+kernel32.lib -L+shell32.lib -L+ole32.lib -L+oleaut32.lib 
-L+olepro32.lib -L+oleacc.lib -L+user32.lib -L+usp10.lib 
-L+msimg32.lib -L+opengl32.lib -L+shlwapi.lib -L+dwt-base.lib 
-L+org.eclipse.swt.win32.win32.x86.lib -L+C:\GITClones\dwt\lib\

I copied most of that command line from the rsp file that is 
generated by build.d when compiling snippets.  I don't know if I 
need all these libs in here.

hello.d is as follows.

/* A Simple DWT window */
module main;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

void main ()
{
     auto display = new Display;
     auto shell = new Shell;
     shell.open();

     while (!shell.isDisposed)
         if (!display.readAndDispatch())
             display.sleep();

     display.dispose();
}

You will need to place hello.d in a directory of your choice and 
create a org and bin directory in the directory that hello.d is 
located.

Also if you wanted to use rdmd below is the commandline I was 
able to get working.

rdmd --build-only -IC:\GITClones\dwt\imp\ 
-JC:\GITClones\dwt\org.eclipse.swt.win32.win32.x86\res\ 
-L/SUBSYSTEM:WINDOWS:4.0 -L+advapi32.lib -L+comctl32.lib 
-L+comdlg32.lib -L+gdi32.lib -L+kernel32.lib -L+shell32.lib 
-L+ole32.lib -L+oleaut32.lib -L+olepro32.lib -L+oleacc.lib 
-L+user32.lib -L+usp10.lib -L+msimg32.lib -L+opengl32.lib 
-L+shlwapi.lib -L+dwt-base.lib 
-L+org.eclipse.swt.win32.win32.x86.lib -L+C:\GITClones\dwt\lib\ 
hello.d

Anyway I would like to determine just what libs are required and 
which ones are not needed unless dmd's linker is only going to 
link in the required libs?  Not sure how it's linker works maybe 
I will do some more reading on it now.

Again I want to thank everyone for their help on this and I think 
I am on my way to building some GUI's with DWT :)
Aug 08 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-08 16:06, JohnnyK wrote:
 On Thursday, 8 August 2013 at 13:07:15 UTC, JohnnyK wrote:
 Ok problem resolved.  I can now compile DWT applications from another
 directory structure outside of the dwt distribution directories.  Below
 is the commandline that I used and I did not have to delete or copy or
 follow any other compile instructions other than what the Author has in
 his Readme file.
I have updated the readme file with instructions to build a Hello World application. It's actually just as easy to use DMD as RDMD. Sorry for all the confusion and inconvenience. https://github.com/d-widget-toolkit/dwt#readme -- /Jacob Carlborg
Aug 08 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Thursday, 8 August 2013 at 15:01:29 UTC, Jacob Carlborg wrote:
 On 2013-08-08 16:06, JohnnyK wrote:
 On Thursday, 8 August 2013 at 13:07:15 UTC, JohnnyK wrote:
 Ok problem resolved.  I can now compile DWT applications from 
 another
 directory structure outside of the dwt distribution 
 directories.  Below
 is the commandline that I used and I did not have to delete or 
 copy or
 follow any other compile instructions other than what the 
 Author has in
 his Readme file.
I have updated the readme file with instructions to build a Hello World application. It's actually just as easy to use DMD as RDMD. Sorry for all the confusion and inconvenience. https://github.com/d-widget-toolkit/dwt#readme
That is so awesome thank you sir. The commandline worked the first try. I know most of the back and forth was due to my ignorance of D and DWT but with this little piece of information makes things so much quicker and easier to get started for us NOOB's.
Aug 08 2013
parent reply "Kagamin" <spam here.lot> writes:
What's the executable size?
Aug 19 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Monday, 19 August 2013 at 13:44:32 UTC, Kagamin wrote:
 What's the executable size?
This particular executable compiled to 2.7MB. Most DWT Executables are between 2.3MB and 3MB. I will say this the executables compress pretty good with the latest UPX exe compressor for windows. With UPX the executable became 766KB in size so in the end it is below 1MB.
Aug 20 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-08-20 15:31, JohnnyK wrote:

 This particular executable compiled to 2.7MB.  Most DWT Executables are
 between 2.3MB and 3MB.  I will say this the executables compress pretty
 good with the latest UPX exe compressor for windows.  With UPX the
 executable became 766KB in size so in the end it is below 1MB.
I'm guessing that most of DWT will always be pulled in when compiling. Hopefully that means that the executable won't grow that much when adding new code from DWT. -- /Jacob Carlborg
Aug 20 2013
parent reply "JohnnyK" <johnnykinsey comcast.net> writes:
On Tuesday, 20 August 2013 at 17:31:30 UTC, Jacob Carlborg wrote:
 On 2013-08-20 15:31, JohnnyK wrote:

 This particular executable compiled to 2.7MB.  Most DWT 
 Executables are
 between 2.3MB and 3MB.  I will say this the executables 
 compress pretty
 good with the latest UPX exe compressor for windows.  With UPX 
 the
 executable became 766KB in size so in the end it is below 1MB.
I'm guessing that most of DWT will always be pulled in when compiling. Hopefully that means that the executable won't grow that much when adding new code from DWT.
So far I have tried different things and I don't see the executables growing much. Still this is by far less than having to deploy the GTK or some other GUI shared library. Also you don't have to worry about updates to externals. So when you compile an app with DWT that app will be the same today, tomorrow and forever. You don't have to worry about a user upgrading their copy of the GTK or some other library and bang your app fails. This is why I worked so hard and wanted to use DWT over GTKd or any of the others. It's self contained. Now I can build an app and send the executable and the user need only copy it to a directory and execute it. Everything for the app can be in that one directory no externals beyond OS specific stuff. BTW I have tried several of the GUI libraries for D and I have only gotten GTKd and DWT to work successfully. Out of the 2 I like DWT better because of the above mentioned reasons. The GTK is just too big and complex to require people to install for a simple utility with a couple of controls to do some simple little thing. Don't get me wrong GTKd works and very well once you get the correct GTK library installed properly. Now this is specific to Windows. Many Linux distros have GTK and most automatically install it when you install the OS. I know nothing about MAC as that OS is not a target for me. The only other thing I am having issues with as far as DWT goes is these darn Layout things. I understand what they are there for but I don't know if I like software moving my controls all over the window without me knowing that they are showing properly. My only advice is when using the layout things once you put the control on the window don't move it or re-size it let the layout thing do that. I have several times now made it where you could not see any controls on the screen because I messed up the layout things. Sometimes the controls would be showing until the user maximizes or re-sizes the screen the window and then the controls would either change size hiding data or other controls messing up the display or totally disappear. Anyway I suggest don't use them until you get more comfortable with DWT. IMHO DWT gives you too much candy to choose from and you could end up with a belly ache if not careful. I say keep things really simple to start. At least that is what I am trying to do for now. Anyway I am a happy DWT user for now. Jacob thank you so much for all your hard work this library does the trick for me.
Aug 21 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-08-21 18:39, JohnnyK wrote:

 Many Linux distros have GTK  and most automatically install it when
 you install the OS.  I know nothing about MAC as that OS is not a target for
me.
Mac OS X uses it's on GUI system, it's not even using X. It was a while since I installed GTK on Windows but it has some problems on Mac OS X. Until quite recently you where forced to install X11 to have GTK work. Thankfully that's not required anymore. One thing I don't like with GTK and even more on Mac OS X is that it's not native. GTK applications look even more alien on Mac OS X because it has a couple of widgets and human interface guide lines that no other GUI system have. Unified toolbar, sheet dialogs, a fixed menu and so on. But I'm working on porting DWT to Mac OS X, since it's my primary platform. I've been working on it for a couple of years now, that's how I started contributing to DWT. Everything compiles but not everything work. It's a time consuming work to try and find all things that don't work.
 The only other thing I am having issues with as far as DWT goes is
 these darn Layout things.  I understand what they are there for but I
 don't know if I like software moving my controls all over the window
 without me knowing that they are showing properly.  My only advice is
 when using the layout things once you put the control on the window
 don't move it or re-size it let the layout thing do that.  I have
 several times now made it where you could not see any controls on the
 screen because I messed up the layout things.  Sometimes the controls
 would be showing until the user maximizes or re-sizes the screen the
 window and then the controls would either change size hiding data or
 other controls messing up the display or totally disappear.  Anyway I
 suggest don't use them until you get more comfortable with DWT.  IMHO
 DWT gives you too much candy to choose from and you could end up with a
 belly ache if not careful.  I say keep things really simple to start.
 At least that is what I am trying to do for now.
I have to admit it was quite a while since I used DWT or SWT. But I have really started to like the layout system used on Mac OS X. There you just place the widget where you want it using the GUI builder. Then you tell it to how to resize it in relation to its super view. It works out quite nicely. I don't remember if it's possible to do in DWT.
 Anyway I am a happy
 DWT user for now.  Jacob thank you so much for all your hard work this
 library does the trick for me.
Thank you, I'm glad that someone is using it. -- /Jacob Carlborg
Aug 21 2013