I've just downloaded GtkD, and I'm trying to find some resources online to help me learn it. However, most of what I find is either for GTK+ (which looks very different to GtkD syntactically), or is very limited in its scope (such as this). Are there any resources out there I have missed? How much help would learning GTK+ be to understanding GtkD? From what I can tell, they look quite different in terms of code.

有帮助吗?

解决方案

Well, my answer will not go far from 'nothing at all', but maybe it'll be of some use.

GtkD is basically a wrapper around GTK+. That means, that there's almost a one-to-one correspondence between its functions. Also, this means that the object models are exactly the same.

E.g. there are such entities like windows, buttons, etc. Those have some relations, like, button can be placed on a window. Conceptually, all of those objects and relations are exactly the same for both GtkD and GTK+ (v3.x).

And for a GUI toolkit this object model is the most important thing to study and understand. Also, it's the biggest thing. So, if you understand this model: what objects there are and how they can be used together - you'll be successful in writing GUI apps using either GTK+ or GtkD.

The syntactical difference you'll need to overcome is pretty trivial compared to this.

I would suggest to use the GTK+ documentation when looking for how-to-do-stuff and use the GtkD documentation to understand how those concepts are implemented in D. E.g. in GTK+ v2.x to add a button on a window you use something like

gtk_container_add (GTK_CONTAINER (window), button);

and in GtkD you can do the same by

window.add(button);

In other situations it can be a bit more complex and not that straightforward at first, but will be more and more easy when you get some experience.

其他提示

Upon further digging, I discovered this (very handy!) series of tutorials on GtkD here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top