gtkd-developers / GtkD

GtkD is a D binding and OO wrapper of GTK+ originally created by Antonio Monteiro
http://gtkd.org
Other
322 stars 71 forks source link

[Question] Using @property syntax? #264

Open LunaTheFoxgirl opened 5 years ago

LunaTheFoxgirl commented 5 years ago

Why does GTK-D use a getter/setter format like you'd be forced to in Java? Is there any particular reason that GTK-D does not use the @property syntax?

Would make it much nicer to read the code being written.

MikeWey commented 5 years ago

For the most part it is because that is what gtk uses.

For structs that have fields that are accessible those are wrapped as properties, but it is mostly GstMpegts where this is the case.

LunaTheFoxgirl commented 5 years ago

So what vala does is just fancy stuff on-top?

MikeWey commented 5 years ago

I think vala uses properties for things that are listed as properties by gobject-introspection. The same scheme could also be implemented for GtkD.

LunaTheFoxgirl commented 5 years ago

That would be quite helpful, even though the property implementation in D is not perfect, It'd make a lot of code look a lot neater.