RSS/Atom feed Twitter
Site is read-only, email is disabled

gimp menu - procedure positions

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

gimp menu - procedure positions Lionel Tarazon Alcocer 20 Dec 20:19
  gimp menu - procedure positions Sven Neumann 20 Dec 20:55
   gimp menu - procedure positions gg@catking.net 20 Dec 22:26
    gimp menu - procedure positions Sven Neumann 20 Dec 22:40
Lionel Tarazon Alcocer
2007-12-20 20:19:07 UTC (almost 17 years ago)

gimp menu - procedure positions

Hi again,

At http://prhlt.iti.es/ we are developing a GIMP plug-in which installs various procedures under /giDoc/. By default the registered procedures appear in alphabetical order under this menu.

Is there a way of controlling the position they occupie instead of having them in alphabetical order?

Thanks

Sven Neumann
2007-12-20 20:55:15 UTC (almost 17 years ago)

gimp menu - procedure positions

Hi,

On Thu, 2007-12-20 at 20:19 +0100, Lionel Tarazon Alcocer wrote:

At http://prhlt.iti.es/ we are developing a GIMP plug-in which installs various procedures under /giDoc/. By default the registered procedures appear in alphabetical order under this menu.

Is there a way of controlling the position they occupie instead of having them in alphabetical order?

No, there is currently no way to control the order in which menu items added by plug-ins appear inside a submenu. Perhaps this could be added but I can't currently imagine how an API for this would look like.

Sven

gg@catking.net
2007-12-20 22:26:19 UTC (almost 17 years ago)

gimp menu - procedure positions

On Thu, 20 Dec 2007 20:55:15 +0100, Sven Neumann wrote:

Hi,

On Thu, 2007-12-20 at 20:19 +0100, Lionel Tarazon Alcocer wrote:

At http://prhlt.iti.es/ we are developing a GIMP plug-in which installs various
procedures under /giDoc/. By default the registered procedures appear in
alphabetical order under this menu.

Is there a way of controlling the position they occupie instead of having them
in alphabetical order?

No, there is currently no way to control the order in which menu items added by plug-ins appear inside a submenu. Perhaps this could be added but I can't currently imagine how an API for this would look like.

Sven

What does the current API look like?

It would seem easy enough to add an extra arguement to indicate the required position in the menu list. A value of minus one could indicate a default placement, be that alphabetical or add-to-the-end.

An additional interface to query the current menu length would seem useful in this context:

int gimp_get_menu_length(menuID)

regards.

.*. /V\
(/ \)
( )
^^_^^

Sven Neumann
2007-12-20 22:40:30 UTC (almost 17 years ago)

gimp menu - procedure positions

Hi,

On Thu, 2007-12-20 at 22:26 +0100, gg@catking.net wrote:

It would seem easy enough to add an extra arguement to indicate the required position in the menu list. A value of minus one could indicate a default placement, be that alphabetical or add-to-the-end.

I don't see how that could possibly work. At the time the plug-in registers the menu entry the length of the menu isn't known. It might be the first plug-in to register or others might have registered there before. The order in which the procedures are registered can not be relied on. Also the plug-in doesn't know anything about the other plug-ins the user might have installed.

The current behavior (sorting alphabetically) is perhaps not ideal but at least it creates a stable and predictable menu order.

What would perhaps help is if we allowed plug-ins to create menu groups. These work like submenus as that anything registered into such a group would be sorted alphabetically within that group. But that group would appear as a group in the menu, perhaps even separated using menu separators.

We already use such a mechanism, called placeholders in GTKUIManager terminology. Look for example at the Print plug-in. It registers into "/File/Send". "Send" is not a submenu of the File menu, but a menu group. This way "Print" appears grouped with "Mail Image". What is missing is an API for plug-ins to create such a group. Perhaps gimp_plugin_menu_group_register() would do the trick. It would work like gimp_plugin_menu_branch_register() but install a placeholder instead of a submenu.

This would not solve all the needs raised by Lionel, but it would probably help a lot already.

Sven