03-24-2025, 12:52 AM
(03-23-2025, 08:27 PM)Ofnuts Wrote: Here: https://testing.developer.gimp.org/resou...a-plug-in/
Thank you very much for the quick response! The "Hello World" example did help a lot for understanding how plug-ins works.
I still struggle with this part in the register() function of v2.x which opens a popup-menu with RATIO and OPTION choices.
Here is the code snippet which can show ShellOut in Filters/ menu but still missing the functionality, I took a look in v3.0 API but got confuse..
Code:
def plugin_main(procedure, run_mode, image, n_drawables, drawables, config, data):
...
class ShellOut(Gimp.PlugIn):
def do_query_procedures(self):
return [PROC_NAME]
def do_create_procedure(self, name):
procedure = Gimp.ImageProcedure.new(self, name,
Gimp.PDBProcType.PLUGIN,
plugin_main, None)
procedure.set_image_types("RGB*, GRAY*")
procedure.set_menu_label("ShellOut...")
procedure.set_attribution(AUTHOR, COPYRIGHT, DATE)
procedure.set_documentation(HELP, DOC, None)
procedure.add_menu_path("<Image>/Filters/ShellOut...")
# FIXME: How to open menu and get return values and pass into main_plugin()?
return procedure
Gimp.main(ShellOut.__gtype__, sys.argv)
Could you help me out here? ? Thank you again!
Best regards,