codebrainz commented on this pull request.
> +
> G_CALLBACK(item_workbench_settings_activate_cb), NULL);
+ geany_plugin_set_data(wb_globals.geany_plugin, menu_data.item_settings,
NULL);
+
+ /* Create new menu item "Close Workbench" */
+ menu_data.item_close = gtk_menu_item_new_with_mnemonic(_("Close"));
+ gtk_widget_show(menu_data.item_close);
+ gtk_menu_append(GTK_MENU (menu_data.menu), menu_data.item_close);
+ g_signal_connect(menu_data.item_close, "activate",
+
G_CALLBACK(item_close_workbench_activate_cb), NULL);
+ geany_plugin_set_data(wb_globals.geany_plugin, menu_data.item_close,
NULL);
+
+ /* Add our menu to the main window (left of the help menu) */
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_data.root_item),
menu_data.menu);
+ gtk_menu_shell_insert
+ (GTK_MENU_SHELL
(ui_lookup_widget(wb_globals.geany_plugin->geany_data->main_widgets->window,
"menubar1")),
+ menu_data.root_item, 8);
You could use `gtk_container_get_children()` and use the list's length to
figure out how many items there are, and then stick yours at -2 from the end.
You could also use `gtk_container_get_children()` and iterate through looking
for the item with the name from the Glade file for the Help menu (not
guaranteed stable, but unlikely to change), and do how you said. Geany has no
really good way to do this.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/598#discussion_r134072816