On Sat, May 05, 2007 at 05:45:06PM +0200, ??ystein Johansen wrote:
>
> Hello?! Wait a minute The macro (G_DEFINE_TYPE) prototypes the
> instance init function to:
>
> static void my_thing_init( MyThing *self);
>
> (line 358 in my gtype.h)
>
> however API reference for GInstanceInitFunc() sa
Øystein Johansen wrote:
> Wow! A really powerful macro. I actually had to run a 'gcc -E' to
> convince myself. Here's what it does:
>
> Declare the functions:
> _init
> _class_init
Hello?! Wait a minute The macro (G_DEFINE_TYPE) prototypes the
instance init function to:
static void my_thing_
David Nečas (Yeti) wrote:
> Actually, what you should do is to use a macro from the
> G_DEFINE_TYPE() family that does these things automaticaly
> (the parent class variable is named _parent_class).
Wow! A really powerful macro. I actually had to run a 'gcc -E' to
convince myself. Here's what it d
On Thu, May 03, 2007 at 08:16:23PM -0300, Alexandre Moreira wrote:
>
> At your class_init you should peek (g_type_class_peek_parent, using
> your class pointer as parameter) a pointer to your parent class and
> keep it in a global storage, accessible to your finalize.
Actually, what you should do
On Thu, May 03, 2007 at 08:03:15PM -0300, Alexandre Moreira wrote:
>
> Hey Yeti, since you're on the subject of object destruction, could you
> explain me the difference between the finalize and dispose methods ? I
> use finalize for everything but I believe I should be using dispose
> somewhere,
On 5/3/07, Øystein Johansen <[EMAIL PROTECTED]> wrote:
> David Nečas (Yeti) wrote:
> > On Thu, May 03, 2007 at 10:40:17PM +0200, ??ystein Johansen wrote:
> >> Aha, but how/where to I set the pointer to the finalize() function?
> >
> > In my_class_init() where you override all other methods.
> > See
On 5/3/07, David Nečas (Yeti) <[EMAIL PROTECTED]> wrote:
> On Thu, May 03, 2007 at 10:40:17PM +0200, ??ystein Johansen wrote:
> >
> > Aha, but how/where to I set the pointer to the finalize() function?
>
> In my_class_init() where you override all other methods.
> See (almost) any Gtk+ widget for e
David Nečas (Yeti) wrote:
> On Thu, May 03, 2007 at 10:40:17PM +0200, ??ystein Johansen wrote:
>> Aha, but how/where to I set the pointer to the finalize() function?
>
> In my_class_init() where you override all other methods.
> See (almost) any Gtk+ widget for examples.
Aha again! I guess I can
On Thu, May 03, 2007 at 10:40:17PM +0200, ??ystein Johansen wrote:
>
> Aha, but how/where to I set the pointer to the finalize() function?
In my_class_init() where you override all other methods.
See (almost) any Gtk+ widget for examples.
Yeti
--
http://gwyddion.net/
___
David Nečas (Yeti) wrote:
> On Thu, May 03, 2007 at 09:51:05PM +0200, ?ystein Johansen wrote:
>> I have an instance struct that has a pointer to a some data that's
>> dynamically allocated in a method. How can I free this memory when the
>> object is finalzed? Is this done automatically in g_object
On Thu, May 03, 2007 at 09:51:05PM +0200, ?ystein Johansen wrote:
>
> I have an instance struct that has a pointer to a some data that's
> dynamically allocated in a method. How can I free this memory when the
> object is finalzed? Is this done automatically in g_object_unref() (when
> refcounter
Hi,
I've just started to use GObject, and I think I understand most of it by
now. There's still some questions remaining. Here's one:
I have an instance struct that has a pointer to a some data that's
dynamically allocated in a method. How can I free this memory when the
object is finalzed? Is th
12 matches
Mail list logo