December 10, 2012
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.
December 10, 2012
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.
December 10, 2012
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.
December 10, 2012
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.
December 10, 2012
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
December 10, 2012
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.
The first programming language I learnt is C#. As you know, VS 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 :)
December 10, 2012
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

February 17, 2014
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"
Top | Discussion index | About this forum | D home