I have configured some build commands for my project:
![geany-build-menu](https://cloud.githubusercontent.com/assets/300211/16819835/e3c17a26-4956-11e...)
In Commander, I can invoke independent commands (such as “Run tests”) and execute commands (such as “Run on test input”), but not filetype-specific commands (such as “Pylint”). It seems like Commander just doesn’t see their labels:
![geany-commander-build](https://cloud.githubusercontent.com/assets/300211/16819891/2b0ae35e-4957-11e...)
--- 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/issues/462
This seems to happen because, when populating the Build menu, Geany [sets text directly on the `GtkLabel` child of the `GtkMenuItem`](https://github.com/geany/geany/blob/6aaaba6b41119cfbe3705d0c993a5cac3223f085...). If I replace that with a simple
gtk_menu_item_set_label(GTK_MENU_ITEM(w), label);
that seems to fix the issue.
@elextr Could you comment on why [you implemented it](https://github.com/geany/geany/blame/master/src/build.c#L1369-1377) like that?
--- 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/issues/462#issuecomment-232496349
@vfaronov as the comment mentions, `gtk_menu_item_set_label()` wasn't added until GTK+ 2.16, and at the time of the referenced commit, [Geany was still supporting GTK+ 2.8](https://github.com/geany/geany/blob/3456b7cc4a048b0352b412a1a9c2c706aedebdfa...). I'm not sure what the mnemonic mention is about though, mnemonics are supported through `_set_label()` as long as `use-underline` is `TRUE`, AFAIK.
That little wrapper function can probably be dropped by now and just set the labels normally.
--- 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/issues/462#issuecomment-232503465
As @codebrainz said.
--- 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/issues/462#issuecomment-232514853
The API exports functions to access the build commands, including the labels. @b4n the commander plugin should be using that, not scraping the widgets.
--- 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/issues/462#issuecomment-232515429
This seems to happen because, when populating the Build menu, Geany [sets text directly on the `GtkLabel` child of the `GtkMenuItem`](https://github.com/geany/geany/blob/6aaaba6b41119cfbe3705d0c993a5cac3223f085...).
Wow, you earned like 10k credits points for finding this out in what looked like a timely manner :+1:
The API exports functions to access the build commands, including the labels. @b4n the commander plugin should be using that, not scraping the widgets.
Well, one of the purpose of the Commander plugin is to be able to trigger *any* menu item generically, without duplicating every feature (or at least knowing about it and labeling it). So I'd rather not special case the build commands if it can be avoided.
--- 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/issues/462#issuecomment-232517747
GTK+ 2.16 is [seven years old](https://blog.gtk.org/2009/03/16/gtk-2160-stable-release/). Would it be reasonable to bump Geany’s GTK+ requirement to >= 2.16 and replace `geany_menu_item_set_label()` with `gtk_menu_item_set_label()`? Mnemonics definitely do work for me with the latter function.
--- 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/issues/462#issuecomment-232523358
@vfaronov it is now [2.24](https://github.com/geany/geany/blob/master/configure.ac#L73) but nobody has changed the original workaround because "if its not broke nobody remembers it"
--- 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/issues/462#issuecomment-232523958
Closed #462 via geany/geany#1396.
github-comments@lists.geany.org