Re: GtkNotebook



Tim Janik <timj gtk org> writes:

> On 5 Aug 2001, Owen Taylor wrote:
> 
> > James Henstridge <james daa com au> writes:
> > 
> > > On Fri, 3 Aug 2001, Padraig O'Briain wrote:
> > > 
> > > > Are there signals I can listen to which will tell me when a page is inserted or
> > > > removed from a GtkNotebook?
> > > 
> > > Just a guess, but the "add" and "remove" signals (from GtkContainer)
> > > probably do what you want.
> > 
> > They don't actually work, because all addition and removal doesn't go
> > through them.
> > 
> > There is currently no reliable way of getting notification on the list
> > of children for a container. [*]
> > 
> > I wonder if we should add something along the lines g_object_notify
> > (container, "children') to gtk_widget_set_parent() /
> > gtk_widget_unparent().
> 
> we need to have a ::children property on containers then,
> and what type should that have? (since we haven't wrapped
> GList in the type system, we could just use GValueArray which
> is somewhat overkill).
> a better idea might be a ::n_children property, however,
> that would cost an int in GtkContainer and count composites as well.

I think a n_children property just so you can get notification
on it is a bad hack. The type of ::children is indeed a problem -
without g_array_type_new (type), anything we have is going
to be artificial, and probably wrong in the long term.
(G_TYPE_POINTER strikes me as being better than GValueArray.)

Maybe the best solution is simply ::child_added ::child_removed
signals and not properties at all.

Regards,
                                        Owen

(A bug needs to be filed about this, since it is pretty darn late for
2.0 at this point. It could be added in 2.2 without breaking bin
compat as long as we didn't have default handlers for these signals.)




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