ofnuts wrote:
Another hackish way:
in first plugin:
- store display ID as integer in a parasite
in second plugin:
- create a Scheme script on the fly that retrieves the display ID and deletes the display (keep the SCM source i a hard-coded string and write it to file)
- invoke it
- remove it
Thanks a lot ofnuts!
This has actually led me on the path to a bearable solution.

But if I were to follow your solution to the letter:
Would I have to register the Scheme script, save it in the scripts folder and then refresh scripts? If not, how do you run unregistered Scheme scripts from a python plugin (and vice versa for that matter).
Anyway, here is the solution I run with so far:
It turns out there is a script-fu interpreter in the pdb. So I can actually use just the display ID. For each display, I keep the display ID as well as a path to the display dump in a parasite. So, when I close a display, I unpickle the corresponding display dump and check the ID. If the ID is zero, I use the ID saved in the parasite. If not, I use the unpickled display object.
The reason that I don't go with the ID all the time is that the script-fu interpreter is very slow (deleting a display takes between one and two seconds).
Here is how I would delete a display with ID==4
pdb.plug_in_script_fu_eval('(gimp-display-delete 4)')
Again, thanks a lot for helping out!!!