On Sonntag, 26. November 2017 15:41:45 CET marty moore wrote:
I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
I'm trying to create a dynamic menu which a user can add new views to.
I've seen, run, and adapted the xml based menus in the tutorial, but they
are static. I've been trying to research Gio::MenuModel, but there isn't
any documentation.
That's correct, and in fact this is from my perspective a big issue for
gtk(mm) 4, which I already criticised. I also provided a patch for gtk(3/4) to
address this:
https://bugzilla.gnome.org/show_bug.cgi?id=791175
However as you can see the patch was declined for a non profound reason from
my perspective. Actually since with gtk(mm) 4 it will apparently no longer be
possible to manipulate the menu at runtime, which caused me to decide to stop
gtk(mm) support with version 3.22.x.
So far, our code base compiles from Gtk 2 up to including (git master head)
Gtk 4, but due to fundamental functionalities being removed from Gtk 4
(without any replacement that is), our apps would not work correctly with Gtk
4 anymore, and hence we will probably completely drop our experimental Gtk 4
code in future again, unless the responsible Gtk maintainers would accept
patches to address those fundamental issues, which I currently don't expect to
happen.
Does anyone have an example of a dynamic menu in gtkmm-3? The method I used
in gtkmm-2 has been eliminated/deprecated.
If you are using Gtk(mm) 3 then the solution is not using the Gio::MenuModel
API but still using the old Gtk::UIManager API. The latter API is deprecated
but is still available with Gtk 3 and there is really no replacement for its
functionality.
CU
Christian
One way to get references to the menu items is to build the menu
with C++ code instead of an XML file, as is done in