[Glade-users] Popup menu's

wdewey@comcast.net wdewey@comcast.net
Sun, 07 Dec 2003 10:32:59 +0000


Using:  Glade 2.0.1; Glademm 2.2.8-2; gtk 2.2.4-1

I have been having problems with popup menu's using glademm.  When I add a popup menu into a window and then try to compile it, I get a "no matching function call to `menu::menu()'".  I posted this on another list and they said I could not generate it as a separate class, but the separate class (and separate file) boxes both say no.  There is a separate file generated though.  When I do the exact same thing with plain old C it works fine.

Then I tried adding my own menu functions to the _glade.hh and _glade.cc files which worked, but then I was having problems connecting signals to the menu items.  I keep getting a "non-lvalue in unary `&'".

I either want to know how to get glademm to generate a popup menu that I can use or how to connect a function that I created to be started by a menu item in the popup menu(or the proper way to create a popup menu).

Thanks for any help that is given!!  This is some of the code for the popup menu's I created.

----------Initialization in the _glade.hh file---------
	Gtk::Menu *muSysAuto;
	Gtk::MenuItem *muHmScnSA;

	Gtk::Notebook *ntMainDisp;
	Gtk::Label *lbCurrMode;
	char cCurrScn;
	char cPrevScn;

protected:

        wdMainDisplay_glade();

        ~wdMainDisplay_glade();
private:
	virtual void cChangeScn() = 0;

--------------constructor in the _glade.cc file-------------------

  muSysAuto = Gtk::manage(new class Gtk::Menu());
   muSysAuto->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Home Screen")));
   muHmScnSA = (Gtk::MenuItem *)&muSysAuto->items().back();

   muSysAuto->accelerate(*this);
   muSysAuto->show_all_children();

   muHmScnSA->signal_activate().connect(SigC::slot(*this, &wdMainDisplay_glade::cChangeScn()));  




Bill Dewey