Hi,
Hi aitor, thank you so much for your examples! I will definitely study them in depth as soon as I get my current problem resolved of how to add a 'Mode' to my menu having a separate Gtk::Builder (aka, how to combine multiple Gtk::Builder objects into a single menu). Or, alternatively, I could have just a single Gtk::Builder object, but then I still need to be able to somehow add a Gio::SimpleActionGroup to my menu. It seems that your approach is entirely different: you have a MenuBar class that deals with everything related to the menu. From an object oriented point of view that makes a lot of sense. You're not using Gtk::Builder at all, but - instead of using an xml string - hardcode the menu into the constructor of myMenuBar.
For some reason you're passing `*this` to every sigc::mem_fun - aka *all* `on_menu_*` menu callbacks are member functions of myMenuBar. I'd prefer it if I could use callbacks that are member functions of several different objects (namely those that they operate on). I suppose I can do that by passing a pointer to all those objects to the constructor of myMenuBar. Currently you pass only a WindowMain*, for the on_menu_mode_quit method. Why are you using the construct of passing this WindowMain* as an argument to myMenuBar::on_menu_mode_quit? Wouldn't it be possible, and make more sense, to do: m_QuitItem->signal_activate().connect ( sigc::mem_fun(*caller, &WindowMain::on_menu_mode_quit) ); ?
m_QuitItem->signal_activate().connect (
sigc::mem_fun(*caller, &WindowMain::hide)
);
https://git.devuan.org/aitor_czr/libnetaid
Thanks for your constructive correctness :)
Aitor.