Re: Recomended cairo bindings

2014-09-15 Thread Paul Z. Barsan via Digitalmars-d-learn
On Sunday, 14 September 2014 at 14:37:05 UTC, Robert burner Schadek wrote: use gtkd they have a cairo binding Well, umm.. the fact is that I want to make my own lightweight cross-platform widget toolkit from scratch and a gtkd dependency is a big no-no. On Sunday, 14 September 2014 at

Re: Recomended cairo bindings

2014-09-15 Thread Edwin van Leeuwen via Digitalmars-d-learn
On Monday, 15 September 2014 at 12:11:09 UTC, Paul Z. Barsan wrote: On Sunday, 14 September 2014 at 14:37:05 UTC, Robert burner Schadek wrote: If you look at deimos.cairo you will see that the latest commit was made 2 years ago while cairoD was last updated 6 months ago. I think the latest

Re: Recomended cairo bindings

2014-09-15 Thread Paul Z. Barsan via Digitalmars-d-learn
On Monday, 15 September 2014 at 12:19:11 UTC, Edwin van Leeuwen wrote: Out of curiosity: What does deimos.cairo add to cairoD? More higher level/d-like API? Cheers, Edwin It's the other way around: cairoD adds D-style wrappers but underneath they use C-style bindings(found in

How to pass a member function/delegate into a mixin template?

2014-09-15 Thread 岩倉 澪
Hi all, I've been reading D Cookbook, in which the author recommends the use of mixin templates to essentially hold boilerplate code for classes (page 28). Referencing TDPL reaffirms this strategy. With this design choice in mind, I would like to be able to use a mixin template that creates

Re: dgui - Button continually repainting

2014-09-15 Thread Mike James via Digitalmars-d-learn
Hi Andre, I've found a solution to the repainting problem. If you tick the Disable visual themes in the compatibility tab of the program properties (associated with the program icon) the button is only repainted when the mouse cursor enters and exits the button area. Regards, -=mike=- On

Re: Recomended cairo bindings

2014-09-15 Thread evilrat via Digitalmars-d-learn
On Monday, 15 September 2014 at 12:11:09 UTC, Paul Z. Barsan wrote: Variables like CAIRO_HAS_XLIB_SURFACE are platform specific, xlib and xcb surfaces are for linux, win32 and directfb surfaces are for windows and so on.. I will search in dubs documentation how can I specify this sort of

commercial application with D

2014-09-15 Thread Andrey via Digitalmars-d-learn
Can I develop commercial application with D programming language?

Re: commercial application with D

2014-09-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Sep 2014 20:02:37 + Andrey via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Can I develop commercial application with D programming language? why not? but better ask your employer, maybe your work contract has some restrictions. signature.asc Description: PGP

Re: commercial application with D

2014-09-15 Thread Justin Whear via Digitalmars-d-learn
On Mon, 15 Sep 2014 20:02:37 +, Andrey wrote: Can I develop commercial application with D programming language? There isn't anything in licensing of DMD, GDC, LDC, or the standard library which would prevent you from using them to create commercial applications.

Re: commercial application with D

2014-09-15 Thread Ali Çehreli via Digitalmars-d-learn
On 09/15/2014 01:02 PM, Andrey wrote: Can I develop commercial application with D programming language? Here is a short list of companies that do that: http://wiki.dlang.org/Current_D_Use Ali

version assignment and module scope

2014-09-15 Thread dcrepid via Digitalmars-d-learn
I'm a bit baffled why using something like this doesn't get recognized by imported modules: version = Unicode; I use this to try and alter the way the win32 API headers resolve certain symbols, but currently the only way to force that version symbol to be recognized correctly is to define it

Re: commercial application with D

2014-09-15 Thread John Colvin via Digitalmars-d-learn
On Monday, 15 September 2014 at 20:02:39 UTC, Andrey wrote: Can I develop commercial application with D programming language? Short answer: Yes, you can, you don't need to even think about it. Long answer: Yes, as long as you conform to the Boost v1.0 license, meaning that if you distribute

Re: How to pass a member function/delegate into a mixin template?

2014-09-15 Thread John Colvin via Digitalmars-d-learn
On Monday, 15 September 2014 at 13:50:22 UTC, 岩倉 澪 wrote: Hi all, I've been reading D Cookbook, in which the author recommends the use of mixin templates to essentially hold boilerplate code for classes (page 28). Referencing TDPL reaffirms this strategy. With this design choice in mind, I

Re: version assignment and module scope

2014-09-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Sep 2014 21:26:27 + dcrepid via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Could this be considered a defect of design? no. it works the way it's intended to work. given that order of module imports is not defined (i.e. reordering imports should not affect

Re: commercial application with D

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 20:45:38 UTC, Ali Çehreli wrote: On 09/15/2014 01:02 PM, Andrey wrote: Can I develop commercial application with D programming language? Here is a short list of companies that do that: http://wiki.dlang.org/Current_D_Use Ali Good list.

Re: version assignment and module scope

2014-09-15 Thread dcrepid via Digitalmars-d-learn
no. it works the way it's intended to work. given that order of module imports is not defined (i.e. reordering imports should not affect resulting code), making 'version=' propagating to other modules will create disasterous side effects, even weirder than C macro abusing. Okay, thanks for

how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread Cassio Butrico via Digitalmars-d-learn
how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts, and need trasformar fractional numbers, so print coretamente. there is some routine that do this?

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread Cassio Butrico via Digitalmars-d-learn
how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts, and need trasformar fractional numbers, so print correctly. there is some routine that do this?

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread ketmar via Digitalmars-d-learn
On Mon, 15 Sep 2014 22:47:32 + Cassio Butrico via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts, and need trasformar fractional numbers, so print correctly. there is

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico wrote: how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts, and need trasformar fractional numbers, so print coretamente. there is some routine that do this? Is the , (comma) the

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:17:51 UTC, AsmMan wrote: On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico wrote: how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts, and need trasformar fractional numbers, so print

core.exception.UnicodeException@src\rt\util\utf.d(400): illegal UTF-16 value

2014-09-15 Thread notna via Digitalmars-d-learn
Hi all. somehow, for me, the following is against the DMD philosophy, because this code builds successfully with DMD and the executable gives the expected result... but also the below strange messages... CODE: - module main; import std.stdio; import std.c.windows.windows;

How do I properly exit from a D program (outside main)?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
Someone said somewhere that call std.c.process.exit() isn't the proper way to exit from a D program since it doesn't terminate some phobos stuff. So what should I use instead of? or there's no a replacement?

Re: How do I properly exit from a D program (outside main)?

2014-09-15 Thread notna via Digitalmars-d-learn
how about return? :) there is also assert... and pls note, scope could also be your friend :O On Monday, 15 September 2014 at 23:36:56 UTC, AsmMan wrote: Someone said somewhere that call std.c.process.exit() isn't the proper way to exit from a D program since it doesn't terminate some

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread Cassio Butrico via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:24:13 UTC, AsmMan wrote: On Monday, 15 September 2014 at 23:17:51 UTC, AsmMan wrote: On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico wrote: how to transform decial point 3.15 to 3,15 comma? Hello everyone, I am making a registry of real amounts,

Re: core.exception.UnicodeException@src\rt\util\utf.d(400): illegal UTF-16 value

2014-09-15 Thread notna via Digitalmars-d-learn
btw., thats the only thing I found for the given error... which is +10years old: http://forum.dlang.org/thread/ccto20$18bq$1...@digitaldaemon.com On Monday, 15 September 2014 at 23:36:53 UTC, notna wrote: Hi all. ... OUTPUT incl. ERROR: -

Re: How do I properly exit from a D program (outside main)?

2014-09-15 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Sep 15, 2014 at 11:36:54PM +, AsmMan via Digitalmars-d-learn wrote: Someone said somewhere that call std.c.process.exit() isn't the proper way to exit from a D program since it doesn't terminate some phobos stuff. So what should I use instead of? or there's no a replacement? AFAIK,

Re: core.exception.UnicodeException@src\rt\util\utf.d(400): illegal UTF-16 value

2014-09-15 Thread Ali Çehreli via Digitalmars-d-learn
On 09/15/2014 04:36 PM, notna wrote: WCHAR lpwszUsername[254]; debug writefln(lpwszUsername.sizeof is %s, WCHAR.sizeof is %s, lpwszUsername.sizeof, WCHAR.sizeof); // DWORD dUsername2 = lpwszUsername.sizeof / WCHAR.sizeof; DWORD dUsername2 = 254;

Re: core.exception.UnicodeException@src\rt\util\utf.d(400): illegal UTF-16 value

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:57:59 UTC, Ali Çehreli wrote: On 09/15/2014 04:36 PM, notna wrote: WCHAR lpwszUsername[254]; debug writefln(lpwszUsername.sizeof is %s, WCHAR.sizeof is %s, lpwszUsername.sizeof, WCHAR.sizeof); // DWORD dUsername2 =

Re: how to transform decial point 3.15 to 3,15 comma?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:43:47 UTC, Cassio Butrico wrote: On Monday, 15 September 2014 at 23:24:13 UTC, AsmMan wrote: On Monday, 15 September 2014 at 23:17:51 UTC, AsmMan wrote: On Monday, 15 September 2014 at 22:45:50 UTC, Cassio Butrico wrote: how to transform decial point 3.15 to

Re: How do I properly exit from a D program (outside main)?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:52:25 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Mon, Sep 15, 2014 at 11:36:54PM +, AsmMan via Digitalmars-d-learn wrote: Someone said somewhere that call std.c.process.exit() isn't the proper way to exit from a D program since it doesn't terminate

Re: How do I properly exit from a D program (outside main)?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
On Monday, 15 September 2014 at 23:42:02 UTC, notna wrote: how about return? :) there is also assert... and pls note, scope could also be your friend :O On Monday, 15 September 2014 at 23:36:56 UTC, AsmMan wrote: Someone said somewhere that call std.c.process.exit() isn't the proper way to

Function Pointers with Type T

2014-09-15 Thread amparacha via Digitalmars-d-learn
Can anyone looks at the following code to fix it.I am having error when using pointers to functions with argument of type T.This is a small portion of a program doing a generic quick sort by passing a comparison function as an argument. import std.stdio; int main(){ return 0; } bool

when should I use a function call without parenteses?

2014-09-15 Thread AsmMan via Digitalmars-d-learn
In which context do you use a function call without paranteses? (considering the function doesn't has arguments or they're default, of couse) I want to know when/why should I use or if it depends only to programmer's coding style.. f / baa.foo versus f() / baa.foo() personally, to me,

Re: when should I use a function call without parenteses?

2014-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 01:11:49 UTC, AsmMan wrote: In which context do you use a function call without paranteses? It is really just personal preference, people tend to leave the parens off when they just add subjective noise. A good rule though would be to leave the parens off

Re: Function Pointers with Type T

2014-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn
You can get the code to compile with two changes: bool function(T)(T val1,T val2) ptr=comp; should be: bool function(T val1,T val2) ptr=comp!T; The function pointer itself isn't a template, so it doesn't need the (T) parameter. Instead, since it is inside a template, you can just use the

Re: Function Pointers with Type T

2014-09-15 Thread ketmar via Digitalmars-d-learn
On Tue, 16 Sep 2014 01:09:27 + amparacha via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: first change: bool function(T)(T val1,T val2) ptr=comp; to auto ptr = comp!T; second change: int partition(T)(T[]list,bool function(T)(T val1,T val2)ptr,int left,int right)} to

Segfault when casting array of Interface types

2014-09-15 Thread rcor via Digitalmars-d-learn
I'm back for another round of is this a bug, or am I doing something stupid?. C and D implement interface I, and I have an array of each. I'd like to combine these into one I[], but eventually I'd like to cast an element back to its original type. interface I {} class C : I {} class D : I

Re: Segfault when casting array of Interface types

2014-09-15 Thread Franz via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 02:21:42 UTC, rcor wrote: I'm back for another round of is this a bug, or am I doing something stupid?. C and D implement interface I, and I have an array of each. I'd like to combine these into one I[], but eventually I'd like to cast an element back to its

Re: Segfault when casting array of Interface types

2014-09-15 Thread Franz via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 03:03:16 UTC, Franz wrote: On Tuesday, 16 September 2014 at 02:21:42 UTC, rcor wrote: I'm back for another round of is this a bug, or am I doing something stupid?. C and D implement interface I, and I have an array of each. I'd like to combine these into one

Re: Segfault when casting array of Interface types

2014-09-15 Thread rcor via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 03:05:57 UTC, Franz wrote: Your issue comme from auto. i is a I[] I expected i to be an I[], but shouldn't a casting an element of an I[] to a C return either a C or null? It is if I do this: I[] i = [cast(I) new C, new D]; assert(cast(C) i[0]); // fine

Re: Segfault when casting array of Interface types

2014-09-15 Thread rcor via Digitalmars-d-learn
seemingly even weirder: I[] i0 = [new C, new C]; assert(cast(C) i0[0]); // fine C[] c = [new C, new C]; I[] i1 = cast(I[]) c; assert(cast(C) i1[0]); // fails It works when I create an I[] from a C[] literal, but not when I cast a previously declared C[] to an I[].

Re: Segfault when casting array of Interface types

2014-09-15 Thread Ali Çehreli via Digitalmars-d-learn
On 09/15/2014 07:21 PM, rcor wrote: I'm back for another round of is this a bug, or am I doing something stupid?. C and D implement interface I, and I have an array of each. I'd like to combine these into one I[], but eventually I'd like to cast an element back to its original type. interface