# PluginEditor ctor

**URL:** <https://forum.juce.com/t/plugineditor-ctor/9736>\
**Category:** Audio Plugins\
**Created:** [December 27, 2012, 10:25pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736 "2012-12-27T22:25:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![voodooRod](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@voodooRod](https://forum.juce.com/u/voodooRod)\
**Post date:** [December 27, 2012, 10:25pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/1 "2012-12-27T22:25:36Z")

</div>

I’m noticing in the debugger that the plugineditor ctor is being called twice. Is this by design or am i doing something wrong?

Just curious. So far, things are working I’m just wondering why?

Thanks

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 27, 2012, 10:28pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/2 "2012-12-27T22:28:21Z")

</div>

I think a temporary editor object might sometimes be constructed if the host needs to know what size it should be before creating the real one.

---

<div class="post-metadata">

**Author:** ![voodooRod](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@voodooRod](https://forum.juce.com/u/voodooRod)\
**Post date:** [December 27, 2012, 10:41pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/3 "2012-12-27T22:41:32Z")

</div>

More info…

I’m using the vstplugin code and the audio processor “createEditor” is being called twice thus the plugin editor ctor is called. Is this by design?

---

<div class="post-metadata">

**Author:** ![voodooRod](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@voodooRod](https://forum.juce.com/u/voodooRod)\
**Post date:** [December 27, 2012, 10:42pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/4 "2012-12-27T22:42:45Z")

</div>

Thanks for the answer. Glad I’m not doing something wrong.

---

<div class="post-metadata">

**Author:** ![myhrman](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@myhrman](https://forum.juce.com/u/myhrman)\
**Post date:** [December 13, 2016, 6:27pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/5 "2016-12-13T18:27:11Z")

</div>

If the PluginEditor CROR is rather heavy, what would be a good way to postpone this heavy work till the real construction of the editor instance that will actually persist? A timer-based approach perhaps, or is there another more elegant way?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [December 13, 2016, 8:51pm UTC](https://forum.juce.com/t/plugineditor-ctor/9736/6 "2016-12-13T20:51:54Z")

</div>

Just don’t do any work until the editor is actually made visible?

---

<div class="post-metadata">

**Author:** ![stefantoon](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@stefantoon](https://forum.juce.com/u/stefantoon)\
**Post date:** [December 22, 2016, 10:53am UTC](https://forum.juce.com/t/plugineditor-ctor/9736/7 "2016-12-22T10:53:56Z")

</div>

Maybe I’m wrong but isn’t the editor made visible in createEditor in the vst wrapper? I’m really trying to find a way to not have to build the whole GUI twice in VST hosts and can’t really figure out how to do it.
