A couple of beginner plugin questions
1) Once a plugin has been launched in the GUI, is there a way to stop a second copy from being launched?
2) Is there a way to make the plugin name bold in its GUI pane?
(I initially posted this in the Support forum before I realised there was a plugin forum)
Comments
1) you could have a setting in the plugin that is checked on starting, if it is set, then close the current instance. If it is not set, then continue.
2) I think not.
In reply to 1) you could have a setting… by jeetee
1) Yes, that would work. I just thought that there might already be a setting in the plugins API to control multiple instances.
2) OK
1) Plugins actually don't exactly work like you think they might: They are loaded on start, which means that if they make a window appear, it will appear on startup too. The signal
run()
(the one implemented byonRun()
) is emitted every time you launch a plugin from the menu.When you click on run from the plugin creator, you actually combine these two steps: you load the plugin and immediately send him the
run
signal. Then, when you reclick start, you get these two steps again, even if in reality, when run from the normal menu, you'd only get the second step. So normally, you will never get a second copy launched.In reply to 1) Plugins actually don't… by ecstrema
If I choose my plugin from the menu then it can show multiple times. It's not a problem since I won't do this in practise but I just wondered whether this could be easily disabled.