Re: GtkImageMenuItem:: forall includes the internal GtkImage Widget?




> On Sat, 2008-05-24 at 15:51 +0000, BJörn Lindqvist wrote:
> On Fri, May 23, 2008 at 11:24 PM, Yu Feng <rainwoodman gmail com> wrote:
> > Hi everyone,
> >
> > Isn't the GtkImage in a GtkImageMenuItem an internal widget?
> 
> No, GtkImageMenuItem is a GtkContainer and the image widget is set
> explicitly as its child, so it is not internal. 
Can you show me an example the user set the image as the container's child?

> gtk_container_forall
> says ""internal" (implementation details of the container). "Internal"
> children generally weren't added by the user of the container, but
> were added by the container implementation itself."
> 

If it is an external child then it should not be treated as a property.

Also, GtkImageMenuItem has to be a bin because GtkMenuItem is a bin. I
think this is a typical application of the 'Decoration' pattern. one has
a widget and one wants something to decorate it without change the
functionality and knowing any details of it.

> I agree that it is a little strange that GtkImageMenuItem is a GtkBin,
> logically it has two children.
It is not only strange but also has practical confusions. How is
GtkBuilder UI Definition solving the confusion between property and
external child?
> 

Yu



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