| Summary: | [Qyoto] Usage of delegates over "connections" desired | ||
|---|---|---|---|
| Product: | [Unmaintained] bindings | Reporter: | Rohde Fischer <krdata> |
| Component: | general | Assignee: | bindings-bugs-null |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | wishlist | CC: | arno |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
You can already connect a signal to a delegate with
Connect(this, SIGNAL("foo()"), delegate {
Console.WriteLine("Hello World!");
});
The problem with mapping signals to .NET events is that signals can be overloaded, but events can't.
I'm thinking about using a syntax like
Connect<int>(this.Signals.Foo, this.Foo) to make it easier to use signals and slots, but this is still not really .NET-like.
If you have ideas on how to improve the situation, feel free to post them here or (better) send them to kde-bindings@kde.org. :)
Closing this as invalid for now.
|
Version: (using KDE 4.3.0) OS: Linux Installed from: Ubuntu Packages First off, I'm sorry for the bad choice of application, there was no proper options for this. I hope someone will correct this. The thing is simple, since Qyoto is a .net-binding for KDE it's desired to use delegates rather than that connect method to attach an action for a button. A code like this: this.Connect(quit, SIGNAL("clicked()"), qApp, SLOT("quit()")); should look either of these: quit.Click += delegate { QApplication.Quit(); // Or whatever method that is appropiate } og like quit.Click += QuitClick; public void QuitClick(object sender, EventArgs args) { QApplication.Quit(); } as you would do with delegates.