Re: GTK_FLOATING broken in 2.9?
- From: James Henstridge <james jamesh id au>
- To: Havoc Pennington <hp redhat com>
- Cc: Dave Benson <daveb idealab com>, Tim Janik <timj imendio com>, Gtk+ Developers <gtk-devel-list gnome org>, Morten Welinder <mortenw gnome org>
- Subject: Re: GTK_FLOATING broken in 2.9?
- Date: Wed, 21 Dec 2005 12:02:15 +0800
Havoc Pennington wrote:
>On Tue, 2005-12-20 at 17:27 +0100, Tim Janik wrote:
>
>
>>GObject:
>>- created with ref_count=1
>>- not initially floating
>>
>>
>
>This is the key I think. The point of my theoretical rant is that I
>think it's really bad if I do:
>
> obj = g_object_new(TYPE_WHATEVER);
>
>and don't know whether I own a refcount or not. The programmer needs to
>know this.
>
>
We are already in this situation with GTK, the rules being:
1. if it is a GtkWindow or subclass, then it is not floating, and you
don't own the reference.
2. otherwise, if it is a GtkObject or subclass it is floating and you
don't own the reference
3. otherwise, if it is some other GObject that implements floating
reference semantics, it will probably be floating and you don't
own the reference
4. otherwise, it is not floating and you do own the reference.
Pushing the floating flag down to GObject seems like it should simplify
things in the long run (even if it will cause some temporary pain for
language bindings). Personally, I found the GtkWindow behaviour a lot
more confusing.
James.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]