Discussion:
[Geany-Devel] How can a plugin invoke menu items/geany actions?
Lars Paulsen
2017-12-20 21:37:37 UTC
Permalink
Hi All,

I would like to start actions in geany from inside a geany plugin?

E.g. start the Color Chooser as if it was selected from the geany tools
menu.
I tried to call the callback function directly but that gives an linker
error for geany plugins (just logical).

Can I fire/send an event/message to make it being started? How do I do that?

Best Regards,
Lars
Lex Trotman
2017-12-20 22:22:17 UTC
Permalink
Post by Lars Paulsen
Hi All,
I would like to start actions in geany from inside a geany plugin?
E.g. start the Color Chooser as if it was selected from the geany tools
menu.
I tried to call the callback function directly but that gives an linker
error for geany plugins (just logical).
Can I fire/send an event/message to make it being started? How do I do that?
https://www.geany.org/manual/reference/keybindings_8h.html#a9b9034dde2091a8d2653d99fcb270a93
Post by Lars Paulsen
Best Regards,
Lars
_______________________________________________
Devel mailing list
https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Matthew Brush
2017-12-20 22:46:05 UTC
Permalink
Post by Lars Paulsen
Hi All,
I would like to start actions in geany from inside a geany plugin?
E.g. start the Color Chooser as if it was selected from the geany tools
menu.
I tried to call the callback function directly but that gives an linker
error for geany plugins (just logical).
Can I fire/send an event/message to make it being started? How do I do that?
If you happen to find one that's not available as a keybinding command,
you can also use `ui_lookup_widget()` to get a handle on the menu item
and then activate it through code (ie. `gtk_actionable_activate()` or
something). This is kind of brittle, but it does work.

Regards,
Matthew Brush
Lars Paulsen
2017-12-21 06:09:22 UTC
Permalink
@Lex, @Matthew: thanks for the quick response.
Post by Matthew Brush
Post by Lars Paulsen
Hi All,
I would like to start actions in geany from inside a geany plugin?
E.g. start the Color Chooser as if it was selected from the geany
tools menu.
I tried to call the callback function directly but that gives an
linker error for geany plugins (just logical).
Can I fire/send an event/message to make it being started? How do I do that?
If you happen to find one that's not available as a keybinding
command, you can also use `ui_lookup_widget()` to get a handle on the
menu item and then activate it through code (ie.
`gtk_actionable_activate()` or something). This is kind of brittle,
but it does work.
Regards,
Matthew Brush
_______________________________________________
Devel mailing list
https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Loading...