Re: problem with custom menu



On Fri, 2005-04-22 at 09:38 -0600, John Taber wrote:
> Thanks for suggestion - it eliminated the error but my menuitems are still not 
> showing

Are you calling show()?

>  (to test I added a second one at 0,1,0,2).  I have read the 
> documentation but I cannot understand what the table is supposed to do and 
> maybe that is where my problem is.  btw other gtk documentation I have showed 
> a far simpler way - was this a change in gtk? or in gtkmm? and is the old api 
> eliminated just not deprecated?  thanks

You'll have to show us what you mean.

> John
> 
> On Friday 22 April 2005 06:24, Murray Cumming wrote:
> > On Fri, 2005-04-22 at 05:41 -0600, John Taber wrote:
> > > I'm having a problem with the newer way to use a custom menu - can
> > > someone help out - thanks.
> > >
> > > fileMenu = new Gtk::Menu();
> > > openMenuItem = new Gtk::MenuItem("Open");
> > > fileMenu->attach(*openMenuItem,0,0,0,0);
> >
> > Table (and Menu, I guess) attach coordinates are a bit odd. Like the
> > warning says, you probably want 0, 1, 0, 1. This is hinted at in the
> > documentation:
> > http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Menu.ht
> >ml#a0
> >
> > I guess this should have default values. A patch would be welcome.
> >
> > But I personally prefer to use the UIManager anyway.
> >
> > > fileMenuItem = new Gtk::MenuItem("File", fileMenu);
> > > menubar = new Gtk::MenuBar();
> > > menubar->append(*fileMenuItem);
> > > mainBox.pack_start(*menubar, Gtk::PACK_SHRINK);
> > >
> > > : Gtk-CRITICAL **: file gtkmenu.c: line 3836 (gtk_menu_attach): assertion
> > >
> > > `left_attach < right_attach' failed
> > > _______________________________________________
> > > gtkmm-list mailing list
> > > gtkmm-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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