Re: GtkWindow destroy problem



On Fri, 7 Sep 2001, Darin Adler wrote:

> on 9/7/01 9:58 AM, Tim Janik at timj gtk org wrote:
> 
> > but if you use GtkObject in a normally refcounted framework other than the
> > gtk widget framework, you should be able to simply do
> >     o = gtk_object_new (GTK_TYPE_OBJECT, NULL);
> >     gtk_object_unref (o);
> > and ignore the gtk specific floating kludge.
> 
> That's what I thought when I started working with Gtk, but after asking lots
> of questions and learning the framework better, I've learned to always doing
> a sink and ref (often in the initialize function) for objects where I am not
> using the floating feature, rather than relying on the knowledge that no one
> will do a sink. Now I learn that you would rather than I didn't do it that
> way -- something new every day!

no, i didn't mean to imply you shouldn't do that. if you really need to
use GtkObject in your framework, e.g. because you're using 1.2, you are
fine with doing ref/sink in the initializer (it's the safer bet anyway).
it is just not required.

> As you say, though, with GObject this fine point becomes much less
> important.
> 
>     -- Darin
> 

---
ciaoTJ





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