On 2016-01-04 17:42:37 +0000, Snke Ludwig said:

Yes, I never had the change to look deep enough into how Cocoa exactly
interacts with the low level event loop so far. I suspect that it will
require custom code instead of using libevent, though.

At least the libevent page states that it works on OSX. But not sure if
this is only for file related things or supports GUI as well. Overall I
think that GCD (Grand Central Dispatch, aka lipdispatch) needs to be
used for GUI stuff.

Maybe [1] and [2] give some more background.

You can of course integrate manually by calling processEvents
periodically (even if that kind of defeats the purpose of event based
I/O, but it's a decent solution at least for games).

Ok. I just try to get a simple example up & running that processes GUI
events on Windows, Linux and OSX.

  1. Are there are any examples WRT to using vibe with a GUI & network
    event loop?

There will be a chapter in the upcoming "D Web Development" book:
https://www.packtpub.com/web-development/d-web-development

Already pre-ordered :-)

I have some internal code, but nothing publicly available. When I get
around to work on this some more to add full OS X support, I'll write
up an article.

That's would be great. IMO if vibe.d supports GUI events for Windows,
Linux and OSX that would be awsome. As most libs & frameworks are
missing these.

  1. Are GUI events for the different platforms are abstracted or native?

Native.

Ok.

For Windows, you basically just have to create your window as usual.
DispatchMessage is called internally to dispatch events to the window
procedure. On X11, you'll have to get the display file descriptor and
use createFileDescriptorEvent to wait for incoming messages. When
something is available for read, use the usual xlib functions to
process individual messages (XPending and XNextEvent).

But events will go through my event handling functions like it's done
for network I/O?

[1]
http://www.raywenderlich.com/79149/grand-central-dispatch-tutorial-swift-part-1

[2] https://www.reddit.com/r/swift/comments/3tert8/swiftasabackendlanguage/

Robert M. Münch
http://www.saphirion.com
smarter | better | faster