Quoting Alan Campbell <gimp-u...@alancampbelllists.ukfsn.org>:

>> > Always got the "Woodrat" folder under File | Create menu, no
>> > shortcut key indicated.
> On 3 Oct 2010 at 11:17:05, Sven Neumann wrote:
>> I am pretty sure that it theoretically should work this way. After
>> all the Script-Fu extension itself creates sub-menus this way and
>> those sub-menus do have mnemonics. You definitely should not use
>> the underscore in the menu-register call.
> I was calling (gimp-plugin-menu-branch-register from top level, i.e.
> it was a statement in scm file along with many (defines.
> So how does that work?  script-fu interpreter processes defines
> first, then any (script-fu-register*) statements, nothing else? Any
> other precedence rules?

It is not a problem with the branch register command not being  
processed, but that branch registration seems to require that plug-in  
be associated with it (see 'plugin_menu_branch_register_invoker()' in  
app/pdb/plug-in-cmds.c). Apparently, when processed at the top level  
of a Script-fu, there is no "current-active-plugin"; and this leads to  
'gimp_marshal_VOID__STRING_STRING_STRING' failing because it is  
missing one of its parameters (the plug-in name).

> I did this:
> (define (wrf_register_menu_branch)
>  (gimp-plugin-menu-branch-register "<Image>/File/Create" "W_oodrat")
>  "_Finger..."
> )
> (script-fu-register  "wrf_create_template_finger"
>   (wrf_register_menu_branch)                ; menu label
> ....
> which works.  (script-fu-register when it runs has to call
> (wrf_register_menu_branch), which does the register thing.

A clever solution. However, I was unable to make it work with GIMP  
2.6.10+. What version of GIMP are you using?

> Anyway, my kludge seems to work.  Thanks for pointer on how to do it.

I'm not sure how robust your kludge is. If it is not version specific  
then it may be working for you (and not me) because of something other  
going on than just the code you posted here (multiple procedure  
registrations in the same file perhaps). Could you provide a complete  
listing of your script?


Gimp-user mailing list

Reply via email to