-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate grestful DelegatePointer code into GtkD #137
Comments
|
invokeDelegatePointerFunc seems to only work with c callbacks that only have a single data parameter. It would be interesting to see if it can be made more generic, so it works for all callbacks. |
|
Hello I've upgraded the import gtkc.gtktypes;
// NOTE: The void* parameter at the end is omitted here as it's being used for the
// delegate conversion. There is no need anymore for it anyways as you can freely
// pass in data into your delegate here.
auto callbackTuple = delegateToCallbackTuple(delegate(GtkTreeView*, GtkTreeViewColumn*, GtkTreeViewColumn*, GtkTreeViewColumn*) {
return 1; // 1 means the drop can proceed, 0 means it can't.
});
someTreeView.setColumnDragFunction(callbackTuple.callback, callbackTuple.data, null);
this.t = callbackTuple.data; // Annoyance, see below.So far there are still two annoyances that I haven't found a good solution for yet:
For the first item, would it be possible for GtkD to generate versions of methods such as PS: It would be even neater if instead of having raw GTK pointers be passed to the delegate, it could automatically convert them to their corresponding D structures (i.e. |
This is an enhancement request, I'm using some code from an open source application called grestful that enables using a delegate with the GTK idle thread processing instead of having to manage a C style function. I'd like to suggest that this code be incorporated into GtkD if you think it makes sense, I found it quite invaluable myself. The code is in the file at the following link:
https://github.com/Gert-dev/grestful/blob/master/Generic/Utility.d
This is a general utility module, the specific code I'm proposing be incorporated is at the end, from the DelegatePointer down to the end. The developer of the code is amenable to having it incorporated into GtkD, see the first reply to the bug request I filed here about a GC issue with the DelegatePointer that he helpfully fixed for me even though it didn't affect his application.
https://github.com/Gert-dev/grestful/issues/1
The text was updated successfully, but these errors were encountered: