Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installing Plugins and Scripts
#8
(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,


Attached Files
.txt   shellout_v3.txt (Size: 8 KB / Downloads: 10)
Reply


Messages In This Thread
Installing Plugins and Scripts - by Leopardo-40 - 03-19-2025, 12:02 AM
RE: Installing Plugins and Scripts - by Ofnuts - 03-19-2025, 06:00 AM
RE: Installing Plugins and Scripts - by Ofnuts - 03-20-2025, 12:13 AM
RE: Installing Plugins and Scripts - by iiey - 03-23-2025, 08:20 PM
RE: Installing Plugins and Scripts - by Ofnuts - 03-23-2025, 08:27 PM
RE: Installing Plugins and Scripts - by iiey - 03-24-2025, 12:52 AM
RE: Installing Plugins and Scripts - by iiey - 03-24-2025, 08:36 AM

Forum Jump: