GNOME Bugzilla – Bug 658766
GObject lacks accessible introduction
Last modified: 2018-05-24 13:20:42 UTC
I hope this doesn't sound like too much of a rant, though it probably is, as so far I have no means of providing actual constructive suggestions. I'm hitting a wall with the introduction to Gobject which I blame mostly on the fact, that the documentation tries to explain the general concepts without actually going deep enough to be applicable. It's like trying to learn science based upon popular science literature: At the end of the day you can lengthly explain what it's all about but you still really have no clue how to do it. I think a good start would be if the code snippets would, at least at parts, not only be snippets but actually working, nonetheless minimal examples (forgoing the boilerplate parts like includes, if you like). In particular I struggle with understanding what I as a user have to do and what the GType system does for me. In particular, one single, but very precise and elaborate description of the chain of events would be particularly helpful. I appreciate the tables at the end of most of the introductory sections, but they are again very general and, standing alone, do not help putting the concepts to use. Something like User calls g_type_create_instance( Desired GType ) => GType System looks up memory required and allocates it => GType System calls XYZ (is XYZ a user defined function or part of GType?) ... etc would greatly help. It poses a great problem that even at the pointer where the GObject as an example for what uses GObject is introduced, I have not the slightest clue how I would create a simple GObject, what the initialisation functions which I specify in GTypeInfo have to do, who allocates the memory where, when and how, and what exactly I have to provide for GType so I get a created object.
hi, there is a tutorial, at https://developer.gnome.org/gobject/2.30/pt02.html but admittedly it is difficult to write a functioning code even by looking at the tutorial (some of the snippets are not even valid C code...) A guy has then rewritten all pieces together into working C code http://arbingersys.blogspot.it/2009/07/missing-gobject-tutorial-sample.html It would be quite useful if those files may become part of the official tutorial... a.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/447.