Re: D is totally useless

2013-05-02 Thread Jacob Carlborg
On 2013-05-02 22:23, Diggory wrote: The wgl*** functions and "SwapBuffers" ARE part of the windows api even though they are implemented in opengl32.dll (they are declared in wingdi.h IIRC) wgl*** is the Windows specific OpenGL functions? Then it make sense to be part of the Windows API. -- /

Re: strange runtime error

2013-05-02 Thread gedaiu
On Thursday, 2 May 2013 at 19:55:23 UTC, Jesse Phillips wrote: On Thursday, 2 May 2013 at 10:30:20 UTC, gedaiu wrote: can anyone help me tu understand this kind of errors? /home/user/workspace/path/project/src(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 8:29, Carlos пишет: I got it working now. I'm using the sample code and I made another layout with Glade for GTK+3 and saved it with the same name, so when I compile the file is called and I get the UI I wanted. SO now next step is to learn the signals part, Right ? right. and it's

Re: C++ and D bool compatibility

2013-05-02 Thread Jeremy DeHaan
On Friday, 3 May 2013 at 01:03:39 UTC, bearophile wrote: Jeremy DeHaan: D bools are 1 byte, and C/C++ chars are 1 byte as well and it works. D bools are 1 byte, but C chars don't need to be 1 byte, so you are working with an implementation detail. Technically speaking, you are right. Gener

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Thursday, 2 May 2013 at 22:07:46 UTC, Mike Wey wrote: On 05/02/2013 11:25 PM, Carlos wrote: Try: dmd testgithub.d $(pkg-config --cflags --libs gtkd-2) It compiles but doesn't run well. I'm checking this comment on the code. /** * Usage ./gladeText /path/to/your/glade/file.glade * */

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Friday, 3 May 2013 at 01:00:48 UTC, Alexandr Druzhinin wrote: 03.05.2013 0:43, Mike Wey пишет: On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote: How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very i

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Friday, 3 May 2013 at 01:27:54 UTC, Carlos wrote: On Friday, 3 May 2013 at 00:58:36 UTC, Alexandr Druzhinin wrote: 03.05.2013 7:55, Carlos пишет: Sorry if this was too wild but this is what I can do at the moment since I don't see a "gladeText" program which I believe is required for this

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Friday, 3 May 2013 at 00:58:36 UTC, Alexandr Druzhinin wrote: 03.05.2013 7:55, Carlos пишет: Sorry if this was too wild but this is what I can do at the moment since I don't see a "gladeText" program which I believe is required for this action I did my guess. code: dmd builderTest.d $(p

Re: C++ and D bool compatibility

2013-05-02 Thread bearophile
Jeremy DeHaan: D bools are 1 byte, and C/C++ chars are 1 byte as well and it works. D bools are 1 byte, but C chars don't need to be 1 byte, so you are working with an implementation detail. I think in C99+ it's better to use uint8_t from stdint.h, that's safely always 1 byte long. Bye,

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 0:43, Mike Wey пишет: On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote: How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very inproductive, so I'd like to get some help or I'm afraid it will be

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 7:55, Carlos пишет: Sorry if this was too wild but this is what I can do at the moment since I don't see a "gladeText" program which I believe is required for this action I did my guess. code: dmd builderTest.d $(pkg-config --cflags --libs gtkd-2) builder ~/Documents/Glade/builderTe

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Friday, 3 May 2013 at 00:30:00 UTC, Alexandr Druzhinin wrote: 03.05.2013 7:24, Alexandr Druzhinin пишет: I can't believe an hour has passed so easy. How do I specify the doferent glade ?, During compilation ? if you mean glade file with different name then answer is yes. but if you just wa

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
I was totally wrong - didn't look at code before :( The right answer to your question is you can specify your own glade file into command line as second argument like this: builder /path/to/your/glade/file/your.glade it will be enough Ok I'll try that.

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Friday, 3 May 2013 at 00:24:50 UTC, Alexandr Druzhinin wrote: 03.05.2013 6:12, Carlos пишет: Normally the example looks for builderTest.glade in the directory where the binary is. There one in the GtkD git https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.glade

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 7:24, Alexandr Druzhinin пишет: I can't believe an hour has passed so easy. How do I specify the doferent glade ?, During compilation ? if you mean glade file with different name then answer is yes. but if you just want to use another glade file with the same name then answer is no.

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 0:43, Mike Wey пишет: There is an small example distributed with GtkD: https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.d Oops, didn't see.

Re: [GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
03.05.2013 6:12, Carlos пишет: Normally the example looks for builderTest.glade in the directory where the binary is. There one in the GtkD git https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.glade You can also specify a different glade file on the commandline, t

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Thursday, 2 May 2013 at 22:07:46 UTC, Mike Wey wrote: On 05/02/2013 11:25 PM, Carlos wrote: Try: dmd testgithub.d $(pkg-config --cflags --libs gtkd-2) It compiles but doesn't run well. I'm checking this comment on the code. /** * Usage ./gladeText /path/to/your/glade/file.glade * */

Re: Getting environment variables?

2013-05-02 Thread Mark Fischer
Better late than never... On Sunday, 23 November 2008 at 02:28:30 UTC, Christopher Wright wrote: ... I thought (perhaps wrongly) C allowed you to declare main as taking a list of environment variables, which is why I asked Indeed, on Unix { not POSIX } and Windows: From Wiki:

Re: [GtkD] How to use Glade?

2013-05-02 Thread Mike Wey
On 05/02/2013 11:25 PM, Carlos wrote: Try: dmd testgithub.d $(pkg-config --cflags --libs gtkd-2) It compiles but doesn't run well. I'm checking this comment on the code. /** * Usage ./gladeText /path/to/your/glade/file.glade * */ Normally the example looks for builderTest.glade in the di

Re: D is totally useless

2013-05-02 Thread Carlos
On Thursday, 2 May 2013 at 04:27:10 UTC, evilrat wrote: On Thursday, 2 May 2013 at 02:07:23 UTC, Carlos wrote: On Wednesday, 1 May 2013 at 08:53:18 UTC, Raphaël Jakse wrote: Le 01/05/2013 10:42, Temtaime a écrit : I'm new in D, so i'm tried to write some in that langugage. That's story about h

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
Try: dmd testgithub.d $(pkg-config --cflags --libs gtkd-2) It compiles but doesn't run well. I'm checking this comment on the code. /** * Usage ./gladeText /path/to/your/glade/file.glade * */

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
I get thhis error when trying to compile it : testgithub.d(3): Error: module Builder is in file 'gtk/Builder.d' which cannot be read import path[0] = /usr/include/dmd/phobos import path[1] = /usr/include/dmd/druntime/import import path[2] = /usr/local/includes/d --

Re: [GtkD] How to use Glade?

2013-05-02 Thread Mike Wey
On 05/02/2013 08:21 PM, Carlos wrote: On Thursday, 2 May 2013 at 17:43:28 UTC, Mike Wey wrote: On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote: How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very inpro

Re: C++ and D bool compatibility

2013-05-02 Thread Jeremy DeHaan
On Saturday, 27 April 2013 at 23:38:17 UTC, bearophile wrote: Jeremy DeHaan: I was reading this: http://dlang.org/cpp_interface.html And it mentions the various types and their compatibility with one another, but it leaves out bools. It would be very useful for me if it works out like this,

Re: D is totally useless

2013-05-02 Thread Diggory
The wgl*** functions and "SwapBuffers" ARE part of the windows api even though they are implemented in opengl32.dll (they are declared in wingdi.h IIRC)

Re: D is totally useless

2013-05-02 Thread Rob T
On Thursday, 2 May 2013 at 04:27:10 UTC, evilrat wrote: learn what? opengl is C API specification, any resource about opengl will work, the only thing required for apply it to D is to know D basics. but unfortunately for D itself it is really hard to find good tutorials I use this on-line boo

Re: D is totally useless

2013-05-02 Thread Jesse Phillips
On Thursday, 2 May 2013 at 07:39:29 UTC, Andrei Alexandrescu wrote: On 5/1/13 6:20 PM, Jesse Phillips wrote: On Wednesday, 1 May 2013 at 22:33:40 UTC, John Colvin wrote: On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote: Because it's full of a drawing and many other functions. OpenGL is

Re: strange runtime error

2013-05-02 Thread Jesse Phillips
On Thursday, 2 May 2013 at 10:30:20 UTC, gedaiu wrote: can anyone help me tu understand this kind of errors? /home/user/workspace/path/project/src(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal9siginfo_tPvZv+0x3e)[0x485ede] Basic translation: core.runtim

Re: a FOR loop and floating variables

2013-05-02 Thread bearophile
Simen Kjaeraas: Both 5 and 9 in the second example are integers (int). When you divide one int by another, the result is an int, and hence (5/9) is 0. Yes, smarter languages (like Pascal..., but also Python, Ada, etc) have two different division operators to avoid such silly C semantics, th

Re: a FOR loop and floating variables

2013-05-02 Thread Martin Drašar
Dne 2.5.2013 20:14, Carlos napsal(a): I have this code : import std.stdio; import std.c.stdlib; void main() { int fahr; write("F\tC\n"); for (fahr = 0; fahr <= 300; fahr = fahr + 20) write(fahr, "\t", (5.0/9.0)*(fahr-32), "\n"); write("Done!\n"); exit (0); } Which works. but if I change the "5

Re: a FOR loop and floating variables

2013-05-02 Thread Simen Kjaeraas
On 2013-05-02, 20:14, Carlos wrote: I have this code : import std.stdio; import std.c.stdlib; void main() { int fahr; write("F\tC\n"); for (fahr = 0; fahr <= 300; fahr = fahr + 20) write(fahr, "\t", (5.0/9.0)*(fahr-32), "\n"); write("Done!\n"); exit (0); } Which works. but if I change the "5.

Re: [GtkD] How to use Glade?

2013-05-02 Thread Carlos
On Thursday, 2 May 2013 at 17:43:28 UTC, Mike Wey wrote: On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote: How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very inproductive, so I'd like to get some help

a FOR loop and floating variables

2013-05-02 Thread Carlos
I have this code : import std.stdio; import std.c.stdlib; void main() { int fahr; write("F\tC\n"); for (fahr = 0; fahr <= 300; fahr = fahr + 20) write(fahr, "\t", (5.0/9.0)*(fahr-32), "\n"); write("Done!\n"); exit (0); } Which works. but if I change the "5.0" for "5" I get cero on the celsius s

Re: [GtkD] How to use Glade?

2013-05-02 Thread Mike Wey
On 05/02/2013 03:58 PM, Alexandr Druzhinin wrote: How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very inproductive, so I'd like to get some help or I'm afraid it will be lasting for years... For example,

[GtkD] How to use Glade?

2013-05-02 Thread Alexandr Druzhinin
How to use GtkD with Glade? Is some tutorial available? I spent some time trying to use Glade to build non-trivial application, but I do it very inproductive, so I'd like to get some help or I'm afraid it will be lasting for years... For example, if somebody would upload some example of Gtk appl

Re: WinAPI callbacks and GC

2013-05-02 Thread Regan Heath
On Wed, 01 May 2013 01:12:39 +0100, Sean Kelly wrote: On Apr 23, 2013, at 2:21 PM, Jack Applegame wrote: According WinAPI documentation, CtrlHandler will be called in new additional thread. Is it safe to allocate GC memory in NOT Phobos threads? If not, how to make it safe? I'm trying

Re: strange runtime error

2013-05-02 Thread evilrat
On Thursday, 2 May 2013 at 10:30:20 UTC, gedaiu wrote: can anyone help me tu understand this kind of errors? /home/user/workspace/path/project/src(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal9siginfo_tPvZv+0x3e)[0x485ede] linux? segfault during unit tes

strange runtime error

2013-05-02 Thread gedaiu
can anyone help me tu understand this kind of errors? /home/user/workspace/path/project/src(_D4core7runtime18runModuleUnitTestsUZb19unittestSegvHandlerUiPS4core3sys5posix6signal9siginfo_tPvZv+0x3e)[0x485ede]

Re: D is totally useless

2013-05-02 Thread Andrei Alexandrescu
On 5/1/13 6:20 PM, Jesse Phillips wrote: On Wednesday, 1 May 2013 at 22:33:40 UTC, John Colvin wrote: On Wednesday, 1 May 2013 at 21:26:32 UTC, Temtaime wrote: Because it's full of a drawing and many other functions. OpenGL is part of WinAPI. Is that strictly speaking true? I didn't think ope