Re: GtkImageMenuItem:: forall includes the internal GtkImage Widget?
- From: Yu Feng <rainwoodman gmail com>
- To: BJörn Lindqvist <bjourne gmail com>
- Cc: gtk-devel-list gnome org
- Subject: Re: GtkImageMenuItem:: forall includes the internal GtkImage Widget?
- Date: Mon, 26 May 2008 16:22:46 -0400
On Mon, 2008-05-26 at 21:34 +0200, BJörn Lindqvist wrote:
> I guess you are right. Other gtkbin containers do not include the
> widget set with set_image in their foreach list. I still think that
> the documentation is ambiguous on this, because it is not exactly
> clear which widgets should be treated as internal and which should
> not.
>
> Is there a specific problem that gtk_image_menu_item_foreach is
> causing other than being wrong?
>
OK everywhere except in my program. I was visiting all the nodes in a
widget tree and generate an XML to describe the widgets(kind of
introspection?). My program also tries to resolve the widgets in the
properties, e.g. "image" property in GtkImageMenuItem. -- however if the
GtkImage is both in a property and enumerated in the foreach loop, the
widget's xml will be generated twice.
If something is inconsistent then there will always be some troublesome
people like me to go into trouble with it. isn't it?
> It is a good idea to report this issue on Bugzilla, otherwise it will
> probably be forgotten.
Yes.
http://bugzilla.gnome.org/show_bug.cgi?id=534979
I wonder if someone is going to review this at all though.
:$
>
> 2008/5/24, Yu Feng <rainwoodman gmail com>:
> >
> >> 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]