(continued)
With the above D code, I get the error:

none of the overloads of connectData are callable using argument types
because

void delegate(Notepad np)

does not match

extern (C) void function() cHandler

connectData seems to be a low level function since most of the parameters are extern(C)

Should I subclass every button? I'd prefer to do what I do in C, set the callback and give it data (an object) to operate on.