The signals and slots should somehow be made better. I'm no expert on this (I'm no expert on anything...) so it would be nice if someone with some experience with them would show up, and write a suggestion how it should be done.
Current situation is not bad, but it could be better.
Currently we have e.g. Button.addOnClicked( void delegate(Button) dlg ) or something like that. It should be made so that it is more flexible. It can't currently accept functions. Only methods (delegates). And only methods that take Button as the only argument. That's not bad, it just isn't flexible.
I'd like something like:
void someFunction() { Stdout("Some func.").newline; }
class someClass
{
void someMethod(){ Stdout("Some method").newline; }
int evenThisSomehow(int arg) { Stdout("arg was:")(arg).newline; return arg; }
int returnSomeInterestingValue() { return interestingValue; }
}
Button myButton = new Button("Click me");
myButton.signalClicked.attach(&someFunction);
myButton.signalClicked.attach(&someMethod);
myButton.signalClicked.attach( Signal.bind( &evenThisSomehow, 5 ) );
//And even this:
myButton.signalClicked.attach( Signal.bind( &evenThisSomehow, &returnSomeInterestingValue ) );
//And that would output when clicked:
Some func.
Some method.
arg was: 5
arg was: 29329387 // or what ever interestingValue was at that time...
And then it should also be possible to overload (or is that redefine) the Button.onClicked() method in your own class MyButton? : Button. (And the onClicked method should be attached to the signalClicked slot by default.) And get that to do stuff that you want.
tango.core.Signal could be used for the signals, but that would tie gtkD to Tango. (IMO that's not a bad thing :) but some won't like it. So until Tango is usable with Phobos or they merge in someway, it might be possible to just copy the Signal implementation from Tango and use it with a different name.) They have the limit of not having return types in signals, which I've filed a ticket in Tango.
Just ideas here...