Re: New GObject Introspection tutorial

On Thu, Jun 13, 2013 at 3:54 PM, Simon Kågedal Reimer
<skagedal gmail com> wrote:

I've written a tutorial on how to make a basic multilevel "Hello
World" using GObject Introspection:

Just a small nitpick, you are missing introspection comments
in the 'greetee' property:

 * TutGreeter:greetee:
 * The entity to greet.
obj_properties[PROP_GREETEE] =

Without comments on properties (and signals), then it becomes impossible
to tell certain things about these entities, such as the ABI version
in which they
are introduced, and whether they are deprecated (this information can be useful
for compilers who wish to implement 'greeter.greetee = greetee' using
so they can warn about use of deprecated properties, or fire runtime errors if
the runtime C library is not as new as the C library which the calling
was compiled for).

Not to mention, it becomes impossible for us to know the version in which
a property was installed in Glade.

While this introspection comment might not be relevant to your tutorial per se,
if we publish this then we will be setting a trend, and it would be nice to set
the trend of complete introspection comments (not to get lazy when it comes
to commenting on properties and signals, which are also a part of the API).


It's written in Mallard; the markup is in a git repository at

There's a fine tutorial on this subject at the Gnome Live wiki, but
there were a few things I thought should be different. It uses
Clutter, which I think gets in the way if you're not already familiar
with that library; I couldn't get it to build since my system has
Clutter 1.0 and the tutorial uses 0.8. I also think it's preferable to
show the build steps such as g-ir-scanner instead of using a build
tool (waf) not all readers will be familiar with, and to not rely so
much on git.

So I wrote this as a way of learning for myself. I was also influenced
by a blog post by Miguel de Icaza to add some exercises. :-) Would
love to get all kinds of feedback, on both content and style. I have
some ideas for future expansion, should really cover annotations e.g.
And I need to figure out how to get yelp-build to use a Gnome standard
style sheet that looks nicer on the web.

Simon Kågedal Reimer
gtk-devel-list mailing list
gtk-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]