dnotify

David d at dav1d.de
Sat Jul 28 16:04:35 PDT 2012


https://github.com/Dav1dde/dnotify

Nothing special, this is just an abstraction for the libnotify binding 
in deimos (pull request not yet merged)

A simple notification bubble looks like this:

auto notification = new Notification("Hello D World", "The D programming 
language is just great and it has long sample texts", "icon.png");
notification.timeout = 5;
notification.urgency = NotifyUrgency.HIGH;
notification.show();
// 2 seconds later
notification.close();
int reason = notification.closed_reason;

As you can see it provides a D style higher level of libnotify. It also 
converts GError's into Exceptions (that's the reason why the C function 
for showing the notification returns a bool and the show method of 
dnotify nothing).

It also translates GList* (linked lists) into D arrays and it takes care 
of freeing memory allocated by libnotify.

Only thing which is not working yet is `notification.set_image` and I 
was not able to figure out the reason (it has to do with some gdk-pixbuf 
internals).

- david


More information about the Digitalmars-d-announce mailing list