[Glade-users] Popup menu's

wdewey@comcast.net wdewey@comcast.net
Mon, 08 Dec 2003 05:18:48 +0000


> Using:  Glade 2.0.1; Glademm 2.2.8-2; gtk 2.2.4-1
> 
> 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 `&'".
> 

Found that the compiler does not like the ()'s after the function name.  I don't 
know 
why, but it works now.

> 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()));  

This is what works: (deleted () after cChangeScn)

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