Re: Error in documentation?



On 2012-07-03 12:02, Sarah Hyder <hyder sarah gmail com> wrote:
Hello,

I'd like to report an error in the GObject Reference Manual. I don't know
if this is correct as I am a newbie but I think the sample code does not
show what the description is specifying. Please tell me if I'm wrong
because this is confusing me.
Thank you.

A better place to ask for help might be gtk-app-devel-list (as there is no dedicated GLib development list) or on #gnome-hackers on irc.gnome.org:

https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
https://live.gnome.org/GnomeIrcChannels

Of course, if you have found a bug, please file it in Bugzilla:

https://bugzilla.gnome.org/

(‘glib’ product, ‘docs’ component would be correct if this was a documentation problem)

In the section  *Instantiable classed types: objects *on line

Every object must define two structures: its class structure and its
instance structure. All class structures must contain as first member a
GTypeClass <http://gobject-Type-Information.html#GTypeClass> structure. All
instance structures must contain as first member a
GTypeInstance<http://gobject-Type-Information.html#GTypeInstance>
structure. The declaration of these C types, coming from gtype.h is shown
below:

The key point here is that the following declarations are of GTypeClass and GTypeInstance, not declarations for classes and instances of your own objects. Therefore, the documentation is correct. Captions for the code listing would help to make this more obvious, of course (if you are interested, the documentation is in the file ‘docs/reference/gobject/tut_gtype.xml’ in the GLib git repository).

http://git.gnome.org/browse/glib

struct _GTypeClass
{
 GType g_type;
};
struct _GTypeInstance
{
 GTypeClass *g_class;
};

The next listing in the tutorial explains what the declarations for a custom object might look like (which I think is what you were expecting), with the paragraphs after that explaining in detail how to look up the type of an instance, using the GTypeClass and GTypeInstance declarations.

--
http://amigadave.com/


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