Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-13 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 13 November 2014 at 05:57:49 UTC, Joakim wrote: On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running

Re: Can't install dub on Debian

2014-11-13 Thread Jordi Sayol via Digitalmars-d-learn
El 13/11/14 a les 07:29, Suliman via Digitalmars-d-learn ha escrit: ... Description:Debian GNU/Linux 6.0.9 (squeeze) ... packages on d-apt repository are created for multiarch systems, Debian 7.x.x and Ubuntu 12.04. Old stable Debian 6.x.x is not. If you want to install dub deb package

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-13 Thread Chris via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 16:10:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 12 Nov 2014 16:03:08 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 12 November 2014 at 14:42:34 UTC, Chris wrote: On Wednesday, 12 November 2014 at

Re: Crash on Windows with core.stdc.stdlib.free()

2014-11-13 Thread ketmar via Digitalmars-d-learn
On Thu, 13 Nov 2014 10:08:47 + Chris via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Interesting though that it never crashes on Linux, only on Windows did this cause problems. seems that libc allocator is not marking free pages as unreadable, and windows libc allocator

Re: Can't install dub on Debian

2014-11-13 Thread Suliman via Digitalmars-d-learn
You are right, after updating Debian to 7.7 dub was installed successfully

Re: Experience report on installing dmd 2.066.1 on OSX

2014-11-13 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 22:38:56 UTC, Ali Çehreli wrote: A friend of mine installed dmd on OSX and recorded his experiences: http://cap-lore.com/Languages/D/Install.html I wonder why he had to do manual work like running xattr. Is that expected on OSX? Thank you, Ali It is

have function must pass delegate.

2014-11-13 Thread Spacen Jasset via Digitalmars-d-learn
A method call in the GTK API takes a delegate as an argument(addOnActivate) I would like to be able to pass a function instead (address of). What is the solution, at present I have a wrapper class around the function.

Re: have function must pass delegate.

2014-11-13 Thread ketmar via Digitalmars-d-learn
On Thu, 13 Nov 2014 14:02:22 + Spacen Jasset via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: A method call in the GTK API takes a delegate as an argument(addOnActivate) I would like to be able to pass a function instead (address of). What is the solution, at present I

Callbacks in D as void functions

2014-11-13 Thread Wsdes via Digitalmars-d-learn
Hi all, I already posted this to Code Project, but maybe you have a solution for my problem. I am trying to write a wrapper for a C API in D. In C I have the following definition of a callback type: typedef void (*Callback)(void*); In a struct all members are of the type Callback. In the main

Re: Callbacks in D as void functions

2014-11-13 Thread bearophile via Digitalmars-d-learn
Wsdes: The wiki says that callback functions should be declared as integer functions, What's bad in returning void? Bye, bearophile

Does the compiler always semantically analyze everything in a project?

2014-11-13 Thread Marco Leise via Digitalmars-d-learn
Specifically, when I put some code in a separately compiled lib, does that save me anything in terms of files that have to be analyzed or will dmd always go through every file that can be reached through includes ? (.di files are out of question, because they have issues) -- Marco

Re: Callbacks in D as void functions

2014-11-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/13/14 9:49 AM, Wsdes wrote: Hi all, I already posted this to Code Project, but maybe you have a solution for my problem. I am trying to write a wrapper for a C API in D. In C I have the following definition of a callback type: typedef void (*Callback)(void*); in D, this would be:

Re: Callbacks in D as void functions

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 14:50:00 UTC, Wsdes wrote: I am trying to write a wrapper for a C API in D. In C I have the following definition of a callback type: typedef void (*Callback)(void*); I would translate this directly to D: extern(C) alias Callback = void function(void*);

Re: Callbacks in D as void functions

2014-11-13 Thread Wsdes via Digitalmars-d-learn
On Thursday, 13 November 2014 at 15:17:45 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 14:50:00 UTC, Wsdes wrote: I am trying to write a wrapper for a C API in D. In C I have the following definition of a callback type: typedef void (*Callback)(void*); I would translate this

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
I wrote a program to get you started. It needs simpledisplay.d and color.d from my github https://github.com/adamdruppe/arsd Just download those two files and put them in your folder along with the following contents as hotkey.d and you should get started. I tested on Windows 7 to hotkey

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki Cattermole wrote: I did find this [0]. I don't know what state its in for compilating/running ext. But it might give you a good starting point. [0] https://github.com/pythoneer/XInputSimulator ooh there's some nice code for Linux in

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
Argh some of the lines got split and broken on the email. to compile: dmd hotkey.d simpledisplay.d color.d -L/SUBSYSTEM:WINDOWS:5.0 should all be on one line. Here's the code to compile: http://arsdnet.net/dcode/hotkey.d Still read the last message though, the lines got split but I added

Re: Callbacks in D as void functions

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 15:58:34 UTC, Wsdes wrote: void MyDtaCB(void* v){ // Do stuff } Events.OnData = cast(Callback) MyDtaCB; this compiles but might crash, the extern(C) is important on a callback to be used from a C program. I'd really recommend adding that to the function,

Re: Does the compiler always semantically analyze everything in a project?

2014-11-13 Thread Dicebot via Digitalmars-d-learn
Apart from unused templates - yes. In abscence of .di files separate compilation only affects generated object files

Re: Callbacks in D as void functions

2014-11-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/13/14 10:58 AM, Wsdes wrote: First of all, the link to the wiki that has an example of callbacks in C and D: http://dlang.org/interfaceToC.html Secondly, I tried your code and that was exactly what I was thinking and what I tried before. Then I thought I'd turn to the wiki example, so

Re: Does the compiler always semantically analyze everything in a project?

2014-11-13 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 13 Nov 2014 16:54:45 + schrieb Dicebot pub...@dicebot.lv: Apart from unused templates - yes. In abscence of .di files separate compilation only affects generated object files I thought so and wonder how that will scale with large code bases. Lately I found so many bugs and

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki Cattermole wrote: I did find this [0]. I don't know what state its in for compilating/running ext. But it might give you a good starting point. [0]

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote: 1) Which compiler should I use? I use the digital mars D. It is pretty easy from the command line, you put the code files in a directory then pop open a cmd prompt in that folder. If the compiler is installed, you should be able to

Re: Basically want to make a macro script

2014-11-13 Thread Israel via Digitalmars-d-learn
On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote: On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki Cattermole wrote: I did find this [0]. I don't know what state its in for compilating/running ext. But it might

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote: On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki Cattermole wrote: I did find this [0]. I don't know what state its in for compilating/running ext. But it might

Re: Basically want to make a macro script

2014-11-13 Thread Israel via Digitalmars-d-learn
On Thursday, 13 November 2014 at 22:20:58 UTC, Casey wrote: On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote: On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 07:01:08 UTC, Rikki Cattermole wrote: I did find this [0]. I don't know

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
All right, let's go through each line here too. On Thursday, 13 November 2014 at 15:59:11 UTC, Adam D. Ruppe wrote: void sendString(wstring s) { This function generates key press and key release events for each character in the string, making it a bit more convenient to use than the

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
I also just now got it to CD to the right directory. I had a suspicion it was having an issue with the second drive, and it was. Just had to type D: and it did the rest.

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 22:35:56 UTC, Casey wrote: Ok so I ran that, and it sends me the error that Windows can't Once you cd to the folder, it becomes pretty simple, just do: dmd hotkey.d simpledisplay.d color.d all three files on one line - that's important because otherwise it

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 22:28:43 UTC, Israel wrote: On Thursday, 13 November 2014 at 22:20:58 UTC, Casey wrote: On Thursday, 13 November 2014 at 21:56:48 UTC, Casey wrote: On Thursday, 13 November 2014 at 16:04:43 UTC, Adam D. Ruppe wrote: On Thursday, 13 November 2014 at 07:01:08

Re: Basically want to make a macro script

2014-11-13 Thread Israel via Digitalmars-d-learn
Maybe a screenshot might help? https://ooymza.dm2301.livefilestore.com/y2mt_9Z73WLi-1zso3LEjdCiC1x-GQzpjlaaftIFJ2Q0cHX2jd9vvwmVldHj1qRROER9IjiA1WwTzln5zveB9ZKZMrb1eeYNUgbzWQJlztqFAvQroAYm0k7_M4fuU3-XzAL/DMD.png

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
I just reorganized the code adding that stuff to simpledisplay.d. I think you should still understand the implementation code so you can customize it, but the main thing should look simpler now: // same command to compile as before: // dmd hotkey.d simpledisplay.d color.d

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
All on the same line... That makes a lot more sense. Sorry, I probably just didn't understand what you meant. I'll do that now and see if I can't get this working. Then I'll try to get it working in a game. I think I'll have to come up with something to add a delay in between the chat key

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 23:54:13 UTC, Casey wrote: All on the same line... That makes a lot more sense. Sorry, I probably just didn't understand what you meant. I'll do that now and see if I can't get this working. Then I'll try to get it working in a game. I think I'll have to

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 13 November 2014 at 23:54:13 UTC, Casey wrote: D:\Documents\Other\Hotkeys\Ddmd Keybinds.d simpledisplay.d color.d Keybinds.d(11): Error: undefined identifier KEYEVENTF_UNICODE That should have been on the last line of the file, maybe it just got cut off in the copying process.

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Thursday, 13 November 2014 at 23:59:59 UTC, Casey wrote: On Thursday, 13 November 2014 at 23:54:13 UTC, Casey wrote: All on the same line... That makes a lot more sense. Sorry, I probably just didn't understand what you meant. I'll do that now and see if I can't get this working. Then

Re: Callbacks in D as void functions

2014-11-13 Thread Mike Parker via Digitalmars-d-learn
On 11/14/2014 12:58 AM, Wsdes wrote: Anyway, I think I got the problem solved. Well, there seems to never have been any problem as I am taught now. I asked the developer of the C API this morning if I should try to implement the callback functions redundantly in D and he said he will have a

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
Well, I edited the code to add the chat button, and as I feared it didn't recignise it in game. However, if I manually press the chat button it'll work fine, so all I need to do is add that delay in, then fine tune it to add all of the different messages I need now. 1)What part of this do I

Kitchen Designs UK

2014-11-13 Thread AbsolutelyNice28 via Digitalmars-d-learn
Kitchen Designs UK. Thirty Ex Display Kitchens To Clear. www.exdisplaykitchens1.co.uk £ 595 Each with appliances. Tel 01616-694785

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
Aha! I found a sleep command. On this page here: http://forum.dlang.org/thread/diuepu$2ebg$1...@digitaldaemon.com Looks like I'd do something like this [code] import std.c.time msleep(1) [/code] Now I'm looking into if there's a way to send a key down, and then up. I don't think this will

Re: Basically want to make a macro script

2014-11-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 14 November 2014 at 02:08:22 UTC, Casey wrote: Well, I edited the code to add the chat button, and as I feared it didn't recignise it in game. However, if I manually press the chat button it'll work fine What exactly happened there? 1)What part of this do I need to keep when

Re: Basically want to make a macro script

2014-11-13 Thread Casey via Digitalmars-d-learn
On Friday, 14 November 2014 at 03:51:17 UTC, Adam D. Ruppe wrote: On Friday, 14 November 2014 at 02:08:22 UTC, Casey wrote: Well, I edited the code to add the chat button, and as I feared it didn't recignise it in game. However, if I manually press the chat button it'll work fine What