www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Hide console of gui program coded by gtkD

reply "December Flower" <boladore hotmail.com> writes:
Hello.

I have a question about how to hide a console window.

http://pds23.egloos.com/pds/201212/10/80/e0088180_50c5e3b1bb789.png

This simple application is made by using gtkD and glade3. As you 
can see from picture above, console window pops up and doesn't 
disappear. When I close the console window, gui window also 
disappears. I also made a simple gui application without glade3, 
but it also showed console window. How can I hide this annoying 
console window?

Regards.
Dec 10 2012
next sibling parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Monday, 10 December 2012 at 13:34:51 UTC, December Flower 
wrote:
 I have a question about how to hide a console window.
Make a .def file and include it on your dmd command line. The file only needs these two lines: EXETYPE NT SUBSYSTEM WINDOWS Call it foo.def, recompile with it on the dmd command line, and you should be in business.
Dec 10 2012
next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
If you want to learn more about def files:

http://www.digitalmars.com/ctg/ctgDefFiles.html

But those two lines I gave are all you need for the console 
problem.
Dec 10 2012
prev sibling parent reply "December Flower" <boladore hotmail.com> writes:
On Monday, 10 December 2012 at 13:42:12 UTC, Adam D. Ruppe wrote:
 On Monday, 10 December 2012 at 13:34:51 UTC, December Flower 
 wrote:
 I have a question about how to hide a console window.
Make a .def file and include it on your dmd command line. The file only needs these two lines: EXETYPE NT SUBSYSTEM WINDOWS Call it foo.def, recompile with it on the dmd command line, and you should be in business.
Thanks. That should do the trick. Anyway, I have another question. does all the irksome things to be considered. Apprently not knowing C language, there're a lot of trivial things(Actually not trivial) like this that is not about programming logic but about language minor specification(Actually not minor). Not trivial, important, not minor, major. Anyway, what I'm trying to say is that is there any good start points to make experiences with D language to build a real-world application using GUI? I finished studying "Programming in D" by Ali Çehreli and that was quite good. But not for me. Anyway, thanks for your reply. Have a nice day :)
Dec 10 2012
parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 12/10/2012 06:30 AM, December Flower wrote:

 Anyway, what I'm trying to say
 is that is there any good start points to make experiences with D
 language to build a real-world application using GUI?
I think D is in need of documentation of that sort. Books like "D for FooLang programmers" would be very interesting.
 I finished
 studying "Programming in D" by Ali Çehreli and that was quite good. But
 not for me.
I am very happy that you've read it. :) As has been discussed on these forums before, that book has been an interesting exercise in teaching programming. In the end, the book may end up requiring too much patience from the reader though: It is very strict on the principle that no D feature should be used before being explained in the book itself. That decision necessarily pushed many useful D idioms to the end of the book. (But to be fair, the book pre-dates some of the cool features of D like ranges, parallelism and concurrency, UFCS, the shorthand lambda syntax, the new operator overloading syntax, etc.) So yes, there must be lots of articles and books that concentrate on practical D programming. Ali
Dec 10 2012
prev sibling next sibling parent "Maxim Fomin" <maxim maxim-fomin.ru> writes:
On Monday, 10 December 2012 at 13:34:51 UTC, December Flower 
wrote:
 Hello.

 I have a question about how to hide a console window.

 http://pds23.egloos.com/pds/201212/10/80/e0088180_50c5e3b1bb789.png

 This simple application is made by using gtkD and glade3. As 
 you can see from picture above, console window pops up and 
 doesn't disappear. When I close the console window, gui window 
 also disappears. I also made a simple gui application without 
 glade3, but it also showed console window. How can I hide this 
 annoying console window?

 Regards.
It happens because in windows you should tell linker that executable should belong to windows subsystem. Normally one have to specify appropriate optlink options (http://digitalmars.com/ctg/ctgLinkSwitches.html#subsystem), but I used PE tools to patch the binary.
Dec 10 2012
prev sibling next sibling parent Jordi Sayol <g.sayol yahoo.es> writes:
Al 10/12/12 14:34, En/na December Flower ha escrit:
 Hello.
 
 I have a question about how to hide a console window.
 
 http://pds23.egloos.com/pds/201212/10/80/e0088180_50c5e3b1bb789.png
 
 This simple application is made by using gtkD and glade3. As you can see from
picture above, console window pops up and doesn't disappear. When I close the
console window, gui window also disappears. I also made a simple gui
application without glade3, but it also showed console window. How can I hide
this annoying console window?
 
 Regards.
 
Pass the following argument to dmd $ dmd.exe -L/SUBSYSTEM:WINDOWS gtkd_app.d Regards, -- Jordi Sayol
Dec 10 2012
prev sibling parent "HSTI_SAURAV" <hsti.saurav yahoo.in> writes:
On Monday, 10 December 2012 at 13:34:51 UTC, December Flower
wrote:
 Hello.

 I have a question about how to hide a console window.

 http://pds23.egloos.com/pds/201212/10/80/e0088180_50c5e3b1bb789.png

 This simple application is made by using gtkD and glade3. As 
 you can see from picture above, console window pops up and 
 doesn't disappear. When I close the console window, gui window 
 also disappears. I also made a simple gui application without 
 glade3, but it also showed console window. How can I hide this 
 annoying console window?

 Regards.
I am using this parameters in command line: "dmd hello.d -L/SUBSYSTEM:WINDOWS+gtkd"
Feb 17 2014