Re: [Gimp-developer] Documentation about menu hooks



Hi,

Akkana already wrote about the most important part, the file
image_menu.xml.in. I'd like to add some things that might be
interesting, too:

1. Positions:
- If you register a script in a menu, i.e. <Image>/File, it
is appended at the end of this menu.
- If you register a script in a placeholder, i.e.
<Image>/Filter/Light and Shadow/Glass, it is also appended
at its end.
- Registering a script in <Toolbox> will append it at the
end of the menubar, that is after the Help menu.
- Registering a script in <Toolbox>/File will append it
at the end of the File menu, after the items registered
at <Image>/File.
However, registrations at <Toolbox> shouldn't happen
anymore as this is deprecated. Register at <Image> instead.
Menus can be subdivided with separators. For instance see
the main menus and Filters/Light and Shadow.
Within every group of menu items are sorted alphabetically
and they are grayed-out if no images are open. Plug-ins
you registered yourself break these two rules.

2. Time of registration:
Registration is triggered on GIMPs initialization and if
you call Filters/Script-Fu/Refresh Scripts.
If you want to look into the code, the function
gimp_plugin_manager_restore in gimp_plugin_manager_restore
is the place to look at. It is called from the after-'restore'
signal callback function in /app/core/gimp. Looking how
the signals 'initialize' and 'restore' are handled will
give more insights if you are interested in that.

3. Conflicts:
First come, first serve: if two scripts register functions with the
same name only the last registration gets a menu item. The
registrations before get lost, but only halfway: all their
positions are replaced with the last registered plug-in,
even if it never registered there (IMHO this is a bug).

If somebody knows more additions are welcome.

>
> I tired to try out how to get my python plugins in the right place. So
> i'd like to do
> a visual documentation for any developer.

+1.

> I attached an example on this mail.

... which was unfortunately cut off. Please don't attach images to the
mailing lists, because the lists areread by ca. 1000 people each and not
everyone of them likes his postbox filled with images without prior
request You will have success if you upload your image to a hoster
and post the link here.

>
> This could be later published on gimp.org.

... and/or the devel-docs folder or the wiki.

Thanks for your suggestion.

Kind regards,

Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]