> On Jun 11, 2022, at 12:58 PM, Ralf Zerres <ralf.zer...@mail.de> wrote:
>
> One open question:
>
> I defined a new submenu gnc-plugin-business-ui.xml
>
> ...
>
> <menu name="Business" action="BusinessAction">
> <menu name="CoOwnerMenu" action="CoOwnerMenuAction">
> <menuitem name="CoOwnerOverviewPage"
> action="CoOwnerOverviewPageAction"/>
> <menuitem name="CoOwnerNewCoOwnerOpen"
> action="CoOwnerNewCoOwnerOpenAction"/>
> <menuitem name="CoOwnerFindCoOwnerOpen"
> action="CoOwnerFindCoOwnerOpenAction"/>
> <menuitem name="CoOwnerNewInvoiceOpen"
> action="CoOwnerNewInvoiceOpenAction"/>
> <menuitem name="CoOwnerFindInvoiceOpen"
> action="CoOwnerFindInvoiceOpenAction"/>
> <menuitem name="CoOwnerNewJobOpen"
> action="CoOwnerNewJobOpenAction"/>
> <menuitem name="CoOwnerFindJobOpen"
> action="CoOwnerFindJobOpenAction"/>
> <menuitem name="CoOwnerProcessPayment"
> action="CoOwnerProcessPaymentAction"/>
> <menuitem name="InvoicesDueReminderOpen"
> action="InvoicesDueReminderOpenAction"/>
> </menu>
> ...
>
> Stupid me: Where do i activate this menu?
> Seems that osx_acel_map isn't used for submenu entries that any more
> ...
>
accelmap is a user customization point for changing menu accelerator keys, it
doesn't load ui files. You have to do that in code with GtkUIManager, see
https://docs.gtk.org/gtk3/class.UIManager.html. There are actually several ways
to pull in a ui.xml file besides direct calls to GtkUIManager. Just grep the
GnuCash sources for "ui.xml" and you'll find several.
Note that GtkUIManager and ui.xml files are for the old GtkMenu design and is
deprecated as of 3.10 and removed in Gtk4, replaced with Glib's GMenu and
related classes. GnuCash will have to follow that redesign at some point
fairly soon (PRs very welcome if somebody wants to take it on!) and we don't
regard that as public API meaning that it will just happen with no deprecation
and no warning.
BTW osx-accelmap is just a template for making a few menu accelerators more
Mac-like. It's only loaded on macOS, but the accelmap mechanism in Gtk is
turned on so users on any platform can use it to customize their menu
accelerators.
Regards,
John Ralls
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel