Re: [gtk-list] I don't understand this...
- From: Tim Janik <timj gtk org>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] I don't understand this...
- Date: Fri, 1 Jan 1999 23:19:58 +0100 (CET)
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]