Re: gobject - A few questinons



Hi Martin,

Martin Klaffenboeck wrote:
Hi there!

I have got a few questions, I couln't figure out or I didn't understand
the Manual/Tutorials I read.

When I inherit an object from another object, I do that with
g_type_register_static () with the first parameter.  Ok.

When I have parent objects created by myselfe, where do I set default
values for variables?  Is it ok to do that in my_object_instance_init
()?
instance_init should be okay. question to the gurus. Should one chain-up here
like in dispose/finalize? - otherwise that would not be called?

Or should I use the constructor for that?

I have one parent which stores some simple information about my object.
The declaration for this is the struct for the parent instance.  When I
use that in a child object, do I have a copy of the parent there?  Or do
I have to cast with MY_PARENTOBJ (self) to get this variables, declared
there?
The cast does it. The struct of the parent is embedded in the beginning of you
child class. Anyway some developers prefer not to use public variables and
access such data vie g_object_get(self,"property-name-1",&property_1,...,NULL);
This methods automatically tries the parent classes up to G_OBJECT.

Can I use this variables more than one time?  Like:  child->data and
parent->data or are this variables equal, do they exist both or only
one?
Huh?

Thanks for your help (even if there will come more questions soon.
Please tell my if this is the right mailling list.
The list is okay.

Martin

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 301166
|      ///           04277 Leipzig      04251 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
|           WWW      www.sonicpulse.de  www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - -  -    -


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