After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 524218 - API needs more convenience functions
API needs more convenience functions
Status: RESOLVED NOTABUG
Product: gedit-plugins
Classification: Other
Component: General
2.22.x
Other All
: Normal minor
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-24 22:22 UTC by Joseph Method
Modified: 2019-03-23 20:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Joseph Method 2008-03-24 22:22:05 UTC
The plugin API needs more direct access to menu operations. For example, if I want to invoke the save file behavior I do this:

self.menubar = self.window.get_children()[0].get_children()[0]
self.save_menu = self.menubar.get_children()[0].get_submenu().get_children()[9]
self.save_menu.activate()

It would be better to have a save_action_on_document(document) convenience function.

Other information:
Comment 1 Steve Frécinaux 2008-03-31 07:17:10 UTC
You can use the UIManager API for that:
window.get_ui_manager().get_action('/MenuBar/FileMenu/FileSaveMenu').activate()