Re: A question about python gimpfu - "home folder"

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

 



On Fri, Oct 10, 2008 at 2:28 AM, David Gowers <00ai99@xxxxxxxxx> wrote:
[...]
>>
>> And (in the interest of being a pest) a follow-up:
>>
>> Can I attach a plug-in to the Palettes sub-menu?
> Other python plugins, like the 'Sort palette' plugin, certainly do.

Hmm - I can't seem to figure this out.  When I register a plug-in on
the Palettes menu, the 'PF_FILE' parameter seems to be ignored.  Can
someone please take a look at the attached test script?  Instead of
getting a GUI file chooser, the main plug-in function is executed, and
the the name of the currently selected palette is passed instead of
"this_file"

Attaching to another menu (<Toolbox>/Xtns/, for example) works as expected.

Thanks,
Chris
#!/usr/bin/env python

from gimpfu import *

gettext.install("gimp20-python", gimp.locale_directory, unicode=True)

def test_attach(this_file):
    print "Test file: " + this_file

register(
    "python-fu-test-attach-menu",
    "Test of PF_FILE from palettes menu",
    "Test of PF_FILE from palettes menu",
    "Chris Mohler",
    "Chris Mohler",
    "2008",
    "<Palettes>/TEST...", 
    "",
    [
        (PF_FILE, "this_file", _("File"), ""),
    ],
    [],
    test_attach, 
    domain=("gimp20-python", gimp.locale_directory)
    )

main()
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux