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

?


On Sun, 26 Jul 2020 20:56:15 +0200
aitor <[email protected]> wrote:

> Hi again,
> 
> On 26/7/20 14:00, aitor_czr <[email protected]> wrote:
> > In the next examples i'll explain how to add an icon factory for
> > your custom stock icons and how to add the toolbar to
> >
> > the project. They'll be uploaded to the following link:
> >
> > https://www.gnuinos.org/Gtkmm%20Examples/
> >
> > Hope this helps,  
> 
> Finally, I added the toolbar with the custom icons:
> 
> https://www.gnuinos.org/Gtkmm%20Examples/Example_4/
> 
> Quote.- The SeparatorToolItem at the left of the last item is missing
> in Gtkmm3:
> 
> https://www.gnuinos.org/Gtkmm%20Examples/Example_4/screenshot.png
> 
> This separator only appears in Gtkmm-2.4 ...
> 
> Cheers,
> 
> Aitor.
> 
> 

_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to