Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commander does not show filetype-specific build commands #462

Closed
vfaronov opened this issue Jul 13, 2016 · 7 comments
Closed

Commander does not show filetype-specific build commands #462

vfaronov opened this issue Jul 13, 2016 · 7 comments

Comments

@vfaronov
Copy link
Contributor

I have configured some build commands for my project:

geany-build-menu

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

@vfaronov
Copy link
Contributor Author

This seems to happen because, when populating the Build menu, Geany sets text directly on the GtkLabel child of the GtkMenuItem. 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 like that?

@codebrainz
Copy link
Member

@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. 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.

@elextr
Copy link
Member

elextr commented Jul 13, 2016

As @codebrainz said.

@elextr
Copy link
Member

elextr commented Jul 13, 2016

The API exports functions to access the build commands, including the labels. @b4n the commander plugin should be using that, not scraping the widgets.

@b4n
Copy link
Member

b4n commented Jul 13, 2016

This seems to happen because, when populating the Build menu, Geany sets text directly on the GtkLabel child of the GtkMenuItem.

Wow, you earned like 10k credits points for finding this out in what looked like a timely manner 👍

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.

@vfaronov
Copy link
Contributor Author

GTK+ 2.16 is seven years old. 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.

@elextr
Copy link
Member

elextr commented Jul 14, 2016

@vfaronov it is now 2.24 but nobody has changed the original workaround because "if its not broke nobody remembers it"

[Edit: Possibly back then the mnemonic didn't happen automatically and had to be forced, don't remember]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants