GUI program on Mac OS in D?

Adam D. Ruppe destructionator at gmail.com
Fri Nov 24 15:09:52 UTC 2017


On Thursday, 23 November 2017 at 17:28:43 UTC, Jacob Carlborg 
wrote:
> I have a simple example [2] of an application that shows a 
> window with a WebKit view, i.e. and embedded browser.

Thanks, this gets me started.

Do you happen to know if there is anything like "pragma(lib)" for 
the -framework argument? (I don't use dub, so I took your config 
there to make my own command line, but it would be nice if I 
didn't have to specify the framework. I use pragma(lib) on 
Windows and Linux so infer it automatically.)

> As you'll see there you need to use some parts of the 
> Objective-C runtime to create class instances and subclasses. 
> Also some gymnastics are required for class/static methods.

Yes, indeed. The old mac code I had here used all the extern(C) 
calls (it was contributed to me by a forum user, I didn't write 
it myself, but did look at it), so some of that is actually 
familiar.


So my plan here is to get more of my libs working on Mac: update 
the old simpledisplay.d port so it runs on the native api again 
(currently it just uses XQuartz), then make my simpleaudio.d use 
OpenAL which I hear has been included with the mac os for some 
time, then maybe even move on to minigui.d and have it use some 
native controls too, if reasonable.

But the first step is just creating a basic window and your code 
worked, so thanks, I am on the path now...



More information about the Digitalmars-d-learn mailing list