The question about the plugin of Filter with Dialog

I wrote a plugin use the Filter with Dialog python temlate, I found when I open the plugin,it run the method of def filter every times, I want it only run the method of def filter when pressed the actionButton, ,I not run when I open plugin every time, the the open the How do I control it?

Have a look at the in the wrapper.

I want to know the method of filter() under what circumstances will it be executed?except run self.update()

You can find all calls to filter() in the And then you can overwrite the method that has the call you don’t like (copy the method into your plugin and remove the call to filter().

The method is called to give the user immediate preview.

How can I set the method for actionButton,it’s means run my codes when the actionButton pressed

Are you using vanilla or Xcode to build the dialog?

yes, I use xcode

This should help:

I want to know how can I set a method for this button in the picture upper. This button is automatically generated after the plug-in is executed,I can’t setting it in the xcode,I think it define attributes and methods in the parent class of ‘FilterWithDialog’,
Is it has API of the write plug-in? I found that I could only learn a few ways to use it only by the file.

This button is hard wired to a method called confirmDialog_(sender). So just add a method with that name.

def confirmDialog_(self, sender):
    # do stuff

Thanks,It’s useful. And I Whenever I execute my plug-in,it always prompts image
Is that necessary? I don’t have to selece a glyph for my plug-in. How can not show it?

A filter is expected to do something with selected layers.
What is your plugin supposed to do? Maybe you should use a different plugin type?

I only write a plugin for merge glyphs,so I write it use anothor plugin type.