Re: bug in gtk_widget_show_all or bug in my understanding



Daniel Weber wrote:
> 
> Bob Lissner wrote:
> 
> > Daniel Weber wrote:
> > >
> > > Bob Lissner wrote:
> > >
> > > > I build a window full of all sorts of stuff.
> > > > At the end i gtk_widget_show_all (thewindow);
> > > >
> > > >   menu = gtk_menu_new ();
> > > >
> > > >       menu_item = gtk_menu_item_new_with_label ("HTML");
> > > >     /* gtk_widget_show (menu_item);  */
> > > >     gtk_signal_connect (GTK_OBJECT (menu_item),
> > > >                         "select",
> > > >                         GTK_SIGNAL_FUNC (fileio_type_change),(gpointer) 2);
> > > >     gtk_menu_append (GTK_MENU(menu), menu_item);
> > > >
> > > >
> > > >   type_button = gtk_option_menu_new ();
> > > >   gtk_option_menu_set_menu (GTK_OPTION_MENU (type_button), menu);
> > > >   type_hbox = gtk_hbox_new (FALSE, 5);
> > > >
> > > > Note that the gtk_widget_show is commented out.  The menu shows, but
> > > > with no text displayed. If I open up the menu,
> > > > the words are there, but they won't display at the top of the menu.
> > > >
> > > >   If I remove the /* */ then everything works fine.
> > > >
> > > > Question:  why doesn't the show_all pick up this menu?
> > > >
> >
> > > Have you tried moving the show after the append?
> >
> > That's not quite the issue.  I should be able to entirely omit the
> > gtk_widget_show because at the end of building the window
> > i issue gtk_widget_show_all.  The question is:  why do I have to issue
> > the gtk_widget_show to make the menu item show?  The show_all
> > should take care of that.
> >
.
> 
> I could be confused, but I was under the impression that for widgets you have to
> set the widget visable and then run the show command on the parent widget.  If the
> child widget is not set visable until after the show command, then the show
> command won't make it visible.  I could be completely off base here, though.....
> I'm just learning the toolset myselft...
> 
we discovered that (except for menus) we can completely eliminate all
gtk_widget_show as we are building a window, and instead
just have a show_all at the end of the code.  It reduced the size of
our code file by 2%.  It's great, except that the menus don't show.  

We think it's a gtk bug because everything else shows, just not the
menu.

=========================
+ Bob Lissner           +
+ Lifestyle Homes, Inc. +
+ www.quicklist.org     +
=========================



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