Web lists-archives.com

GMenu items with detailed action names not working

Hi all,

I am trying to add three items to a toolbar submenu, that when clicked should open the default browser with a particular url.

I came up with something like:

<?xml version="1.0"?>
<menu id="menubar">
<attribute name="label">_Help</attribute>
<attribute name="id">help-section</attribute>
<attribute name="label">Visit site a</attribute>
<attribute name="action">app.help-url('https://a.com')</attribute>
<attribute name="label">Visit site b</attribute>
<attribute name="action">app.help-url('https://b.com')</attribute>
<attribute name="label">Visit site c</attribute>
<attribute name="action">app.help-url('https://c.com')</attribute>

In my GtkApplication derived class:

static GActionEntry app_entries[] = {
{"help-url", help_url_activated, "s", NULL, NULL},

This causes the items to be shown in the menu, but they are not sensitive (cannot be activated).

The real example is considerably more complicated and also contains menu items with actions that do not require a parameter: these all work fine.

I am using the latest versions of Gtk+3 and Glib, in case it matters...

No errors or warnings are being shown in the terminal.

Many thanks for your comments in advance,

gtk-list mailing list