Re: [gtk-list] I don't understand this...



On Thu, 31 Dec 1998, Robert Kallal wrote:

> 
> 
> In GtkPaned the following is done:
> ==================================
> 
> static GtkType
> gtk_paned_child_type (GtkContainer *container)
> {
>   if (!GTK_PANED (container)->child1 || !GTK_PANED (container)->child2)
>     return GTK_TYPE_WIDGET;
>   else
>     return GTK_TYPE_NONE;
> }
> 
> 
> Why isn't it this?:
> ===================
> static GtkType
> gtk_paned_child_type (GtkContainer *container)
> {
>   if (GTK_PANED (container)->child1 || GTK_PANED (container)->child2)
>     return GTK_TYPE_WIDGET;
>   else
>     return GTK_TYPE_NONE;
> }
> 
> 
> 
> I would think that you would want to return that it was GTK_TYPE_WIDGET 
> if either of the children are attached/set/valid?
> 
> Could someone explain the reason that the first is correct?

gtk_container_child_type() returns the base type that a certain container
expects for the next chil dto be added. thus i both paned children are set,
a paned expects no more children: GTK_TYPE_NONE.

> 
> 
> Robert (learning GTK) Kallal
> 

---
ciaoTJ



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