-
Notifications
You must be signed in to change notification settings - Fork 80
multiple inheritance #20
Comments
What about using type unions for this purpose. For the GtkTreeModel interface I have used a definition
It would be more convenient to somehow extend the Alternative: Introduce multiple inheritance in Julia. I am not sure how likely it is that this will ever happen. You have a better feeling about that |
I have the same problem in GI.jl (gobject-introspection generated bindings). For instance in Clutter, Container is an abstract interface and not a base object like in Gtk. I'm also considering Union(...) but the problem with this is AFAIK there is no convenient way to add new concrete types to it afterwards, which can happen if you import an extension library that defines more widgets/actors. Right now i just prefix interface methods with the interface name, i e container_add_actor but I don't know the best way to then define the more convenient push!(ClutterContainer, ClutterActor) . Multiple inheritance of abstract types would have been the simplest indeed. |
Yes, the Union method is limited and it will not allow to extend the type. It might be possible that extending Unions are easier to implement than MI in Julia. Will ask in the MI issue in the Julia bug tracker. Although the Union method is limited, it allows to implement against interfaces and, in the case MI comes, one would only need to change the type definitions and the implemementations can stay. |
To be able to use the setter of interfaces using the aforementioned Union method, one has to write one conversion method, i.e.
But with that I am able to use the GtkTreeModel setter now (have not tested the getter though) |
Actually I have not tried to use a setter of TreeModel yet. But the conversion allows to use a setter of TreeView that has a TreeModel as argument |
Automatic getter/setter generation works when putting the interface to the code gen script. (yes I have clang+gtk@mac working now) |
@tknopp that error actually means that gtk_get_set_gen didn't know |
I see. |
we are missing a lot of accessor methods due to the lack of multiple inheritance support in Julia. somehow we need to fake support for it
The text was updated successfully, but these errors were encountered: