Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-15 Thread Mike McKee via Digitalmars-d-learn
On Tuesday, 15 December 2015 at 07:52:50 UTC, Jacob Carlborg wrote: Could you please add "-v" do the command line when compiling. Mine was completely different: $ dmd -v test.d binarydmd version v2.069 config/usr/local/bin/dmd.conf parse test importall main importobject

Re: Error: undefined identifier 'selector'

2015-12-15 Thread Mike McKee via Digitalmars-d-learn
I found the fix: $ sudo brew update $ sudo brew uninstall --force dmd $ sudo su $ cd /Library $ rm -rfd D $ exit $ sudo brew install dmd This not only takes one from an older dmd to a more current version (in my case, from 2.068 to 2.069), but it also fixes a bug where /Library/D doesn't get

I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
I finally managed to get it working, using some help from this forum and stackoverflow.com, and a little bit of random luck with tests. // test.d extern (C++) immutable(char)* dfunc(const char *s) { import std.string; return toStringz(fromStringz(s) ~ "-response"); } I

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 December 2015 at 19:13:20 UTC, bachmeier wrote: Is it okay if I copy your post to the wiki at this link? http://wiki.dlang.org/Cookbook Sure! :) Feel free to fix grammar or anything out of sorts (or could be better said), if you want. My goal is to enable more people to be

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 December 2015 at 18:13:02 UTC, Mike McKee wrote: I think I installed dmd through homebrew. I don't know how to update it -- I'm still green when it comes to homebrew and only know apt-get from Ubuntu Linux. Oh, I found I could do: $ sudo brew update $ sudo brew upgrade dmd Now

Re: I Did It! Calling D Library from Objective C in XCode on OSX

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 December 2015 at 17:28:20 UTC, Jacob Carlborg wrote: [1] http://dlang.org/spec/objc_interface.html Unfortunately, my version of DMD on this OSX doesn't support the (Objective-C) extern when I run the example given at the bottom of that objc_interface.html page. $ dmd -m64

Error: undefined identifier 'selector'

2015-12-14 Thread Mike McKee via Digitalmars-d-learn
When I run this piece of code: // FROM: https://dlang.org/spec/objc_interface.html module main; extern (Objective-C) interface Class { NSString alloc() @selector("alloc"); } extern (Objective-C) interface NSString { NSString initWithUTF8String(in char* str)

Re: Drawing Native OSX Windows with D

2015-11-29 Thread Mike McKee via Digitalmars-d-learn
A few interesting things here. I tried to do these things via the new Apple language, Swift. * You can enum windows, but unlike Microsoft Windows, you have no permissions to hide a window. BTW, hiding a window is a window object method called orderOut(nil), and they only permit it on your

Getting GtkD to work on OSX

2015-11-28 Thread Mike McKee via Digitalmars-d-learn
I have GtkD working just fine on Ubuntu Linux. Now I'm trying to get it to work on my Mac with the same hello.d codebase and hello.glade file. (Demo here: http://stackoverflow.com/a/32535987/105539) What's the procedure to getting GtkD installed on OSX?

Drawing Native OSX Windows with D

2015-11-28 Thread Mike McKee via Digitalmars-d-learn
Does anyone have a demo that shows how I can call the native OSX API to draw a basic window that's minimizable and can be closed? I was thinking of making an installer for the Mac, you see. So for instance, people would download a very thin .app file and run that. Because it only uses native

Re: Multithreaded HTTP Download

2015-11-28 Thread Mike McKee via Digitalmars-d-learn
After weighing options, I'll use a CDN to get the faster download, and stick with curl rather than recoding it in D.

Re: Drawing Native OSX Windows with D

2015-11-28 Thread Mike McKee via Digitalmars-d-learn
On Saturday, 28 November 2015 at 14:05:37 UTC, Jacob Carlborg wrote: If you can't/don't want to go with the App Store then why not the second option? I'm coding an antivirus application for the Mac, using a third-party antivirus engine, in Qt/C++. It needs some things to run under high

Re: Getting GtkD to work on OSX

2015-11-28 Thread Mike McKee via Digitalmars-d-learn
On Saturday, 28 November 2015 at 13:44:04 UTC, Gerald wrote: https://github.com/gtkd-developers/GtkD/wiki/Mac-OS-X-Notes That seemed really, really confusing to me. I don't even know where to begin.

Re: Multithreaded HTTP Download

2015-11-27 Thread Mike McKee via Digitalmars-d-learn
Hey guys, as it turns out, someone on stackoverflow.com pointed out in a Perl version of this question that the Bash example that was given is really buggy and doesn't make sense. They say that trying to download a single file using two socket handles will not speed up the download. So, this

Multithreaded HTTP Download

2015-11-27 Thread Mike McKee via Digitalmars-d-learn
Looking at this example that's an all-Bash technique, someone has figured out on OSX (and Unix, Linux, FreeBSD, etc.) how to use /dev/tcp and download a zip file in a multithreaded way (they use only two threads, but you get the point):

Tutorial on C++ Integration?

2015-09-28 Thread Mike McKee via Digitalmars-d-learn
I'm using Qt/C++ on a Mac. I want to try my hand at making a dylib in D that can receive a C++ string, reverse it, and respond with the result back to Qt/C++. Are there any easy tutorials out there with something simple like that? You probably want me to type some code so that I showed that

Mac IDE with Intellisense

2015-09-26 Thread Mike McKee via Digitalmars-d-learn
I've tried Sublime Text 3 editor on the Mac, but even it doesn't seem to have the D2 language in it yet (only D), and doesn't have intellisense for components in the imports that I do, even after saving the file after adding the import statements. What OSX editor do you recommend that would

Re: Mac IDE with Intellisense

2015-09-26 Thread Mike McKee via Digitalmars-d-learn
On Saturday, 26 September 2015 at 10:31:13 UTC, wobbles wrote: Have you installed dkit for sublime? As in? https://github.com/yazd/DKit Looks like it's alpha and doesn't run on Mac? No homebrew install?

Re: Mac IDE with Intellisense

2015-09-26 Thread Mike McKee via Digitalmars-d-learn
On Saturday, 26 September 2015 at 10:38:29 UTC, Gary Willoughby wrote: Both these forms are the same. It's called UFCS (uniform function call syntax). Here's some material to help you understand what's going on here: http://ddili.org/ders/d.en/ufcs.html

Re: Best Direction on Spawning Process Async

2015-09-16 Thread Mike McKee via Digitalmars-d-learn
Beautiful, Ali. Took me a bit to read here... http://dlang.org/phobos/std_concurrency.html ...but I realized that receiveTimeout() was a std.concurrency class method.

Re: Best Direction on Spawning Process Async

2015-09-16 Thread Mike McKee via Digitalmars-d-learn
This really shows the beauty and simplicity of the D language compared to C++. Check this out in Qt/C++: http://stackoverflow.com/questions/32593463/spawn-async-qprocess-from-dynamic-library-peek-output-until-done ...see how much nicer the D version is here that Ali did, versus the Qt/C++

Best Direction on Spawning Process Async

2015-09-15 Thread Mike McKee via Digitalmars-d-learn
What's the best direction from... http://dlang.org/phobos/std_process.html ...on spawning an async process and then peeking at it occasionally as it runs, and then get notified when it finishes? In other words, what std.process functions would you recommend I use? What I want to avoid is a

Load Qt UI XML File as GUI

2015-09-15 Thread Mike McKee via Digitalmars-d-learn
Unfortunately, the http://dsource.org/forums/ doesn't appear to be active -- I can't login after I registered. This is where the QtD project has their forum. So, I'm asking this here. Is it possible with D and QtD to draw my GUI using QtCreator, and then take its UI XML file and load it

Re: Load Qt UI XML File as GUI

2015-09-15 Thread Mike McKee via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 04:36:15 UTC, Steven Schveighoffer wrote: Seems to have moved here, but it doesn't look fresh: https://bitbucket.org/qtd/ Yep, but when I poke around in the source, I can't see anywhere that the QtD can read the .ui files that QtCreator creates.

Canvas in Gtk connected to D?

2015-09-14 Thread Mike McKee via Digitalmars-d-learn
Is there a way to do a canvas in GTK3 so that I can use chart.js, and connect this to D? See, in something similar, a guy named Julien Wintz figured out that Qt's QQuickWidget acts much like the webkit Canvas object, and thus was able to port chart.js to that widget. This allows one to use Qt

Re: Canvas in Gtk connected to D?

2015-09-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 September 2015 at 19:56:57 UTC, Justin Whear wrote: Mike, as this is really a GTK3 question and not specific to D (if GTK will let you do it in C, you can do it in D), you might have better success asking the GTK forum (gtkforums.com). Another avenue of research would be to look

Re: Canvas in Gtk connected to D?

2015-09-14 Thread Mike McKee via Digitalmars-d-learn
On Monday, 14 September 2015 at 21:57:23 UTC, Mike McKee wrote: I'll ask in the GTK Forums what they recommend as the most recently recommended approach for doing static charts in GTK3. BTW, the gtkforums.com site doesn't just let anyone in. I'm still waiting on an admin to approve me. :(

Re: Hello World Example with Glade?

2015-09-12 Thread Mike McKee via Digitalmars-d-learn
On Saturday, 12 September 2015 at 09:03:53 UTC, Russel Winder wrote: Once you get to a GtkD application bigger than "Hello World" create a project and use Dub. Oh yes, Dub. That's the ticket. Thanks, mate.

Re: Hello World Example with Glade?

2015-09-12 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 20:29:05 UTC, Mike Wey wrote: You should be able to drop the -L-ldl and -I/usr/ flags, as they are included in the pkg-config output. I just tested and you are correct. Now, is there a way that I can edit /etc/dmd.conf and make it so that I don't need to do

Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Ubuntu Linux, I can draw a simple Hello World interface (and a button on it to close the window) with Glade and save the file. Now how do I use GtkD and D to load that interface? Anyone got a super simple tutorial for that?

Re: Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 06:00:39 UTC, Mike McKee wrote: On Ubuntu Linux, I can draw a simple Hello World interface (and a button on it to close the window) with Glade and save the file. Now how do I use GtkD and D to load that interface? Anyone got a super simple tutorial for that? I

Re: Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 07:39:46 UTC, Mike James wrote: try # dmd test1.d -I/usr/include/dmd/gtkd3 # dmd test1.d -L-ldl -I/usr/include/dmd/gtkd3 test1.o:(.rodata+0x12c): undefined reference to `_D3gtk7Builder12__ModuleInfoZ' test1.o:(.rodata+0x130): undefined reference to

Re: Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 06:53:07 UTC, Mike James wrote: There's a Glade example in the demos/builder directory... I'm having trouble installing GtkD on Ubuntu Linux 14.04. I did the apt steps from here: http://d-apt.sourceforge.net/ $ sudo su # wget

Re: Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 07:20:57 UTC, Mike James wrote: It looks last keep you're missing an import path (-Ipath_to_source). Check out http://dlang.org/dmd-linux.html#switches I tried this just now: # dmd test1.d -I/usr/include/dmd/gtkd3/gtkc /usr/include/dmd/gtkd3/gtkc/gtk.d(28):

Re: Hello World Example with Glade?

2015-09-11 Thread Mike McKee via Digitalmars-d-learn
On Friday, 11 September 2015 at 09:07:37 UTC, Jordi Sayol wrote: On there is the "pkg-config" section: I finally got it to compile with your help, guys! :) Here's what I had to type: # dmd test1.d -L-ldl -I/usr/include/dmd/gtkd3 `pkg-config --cflags --libs

Interfacing Chromium & SQLite

2015-09-05 Thread Mike McKee via Digitalmars-d-learn
On a Mac (Yosemite version), how would I create a window in D, embed Chromium, use D to show a local SQLite test database (id, firstname, lastname) inside Chromium, and let someone have a small search form to do like a "full name" search that goes back to D to query the database again?