# \[4.6.1 - Plugin\] Why do FLevelEditorModule::RegisterTabSpawner generates two menu entries for my tab?

**URL:** <https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134>\
**Category:** UI\
**Tags:** level-editor, tabs, unreal-engine, slate, Plugins, CPP, question\
**Created:** [January 27, 2015, 11:38am UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134 "2015-01-27T11:38:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [January 27, 2015, 11:38am UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/1 "2015-01-27T11:38:36Z")

</div>

I’m developing a plugin for _Optitrack_ that have a tab to interface the server. When I register my tab-spawner using **FGlobalTabmanager** it works as expected but the tab is not dockable into the _Level Editor_. Instead when I use **FLevelEditorMoudule** the tab is dockable like the _ContentBrowser_ tab but it also generates two entries for the tab inside the “ **Window** ” menu. Why do this happen? How can I control whether or not generate these menus?

Here’s a picture that explains the overall situation: (full size) [http://i.imgur.com/J7zbXT6.jpg](http://i.imgur.com/J7zbXT6.jpg)

[http://i.imgur.com/J7zbXT6.jpg](http://i.imgur.com/J7zbXT6.jpg)

---

<div class="post-metadata">

**Author:** ![szyszek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@szyszek](https://forums.unrealengine.com/u/szyszek)\
**Post date:** [January 27, 2015, 12:22pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/2 "2015-01-27T12:22:06Z")

</div>

Hi,

Are you adding a MenuEntry using MenuExtender somewhere in your code? Maybe youre adding one entry by yourself and LevelEditorModule adds another one when you register your tab spawner?

---

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [January 27, 2015, 1:17pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/3 "2015-01-27T13:17:44Z")

</div>

Nope, this is pretty much all the code that initializes the plugin module. If I comment the highlighted block of code it does not generate the menu anymore. I’ve added a link to the image with better readability.

---

<div class="post-metadata">

**Author:** ![szyszek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@szyszek](https://forums.unrealengine.com/u/szyszek)\
**Post date:** [January 27, 2015, 1:54pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/4 "2015-01-27T13:54:47Z")

</div>

I see. I just dont get it why you’re binding function that registers tab spawner to level editor’s tab spawner `OnChanged` event. Most likely it gets called twice.

Try to register your tab spawner only once, during plugin startup like this:  
LevelEditorModule.GetLevelEditorTabManager()-\>RegisterTabSpawner(…)

---

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [January 27, 2015, 2:07pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/5 "2015-01-27T14:07:05Z")

</div>

Because at this point the LevelEditorModule.GetLevelEditorTabManager() returns a nullptr. The tabmanager is not ready yet, that’s why I have to use the event.  
And no, it’s called just once. I’ve set a breakpoint and it stops only once. I’m trying to understand what happens when I register the tabspawner. And why it doesn’t happen when I use the global tab manager.

---

<div class="post-metadata">

**Author:** ![szyszek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@szyszek](https://forums.unrealengine.com/u/szyszek)\
**Post date:** [January 27, 2015, 2:19pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/6 "2015-01-27T14:19:33Z")

</div>

Meh, I didnt notice that you are trying to register tab spawner with GlobalTabManager istead of registering Nomad tab spawner, like this:

FGlobalTabmanager::Get()-\>RegisterNomadTabSpawner(…)

This way you can get your tab to be dockable everywhere and by using MenuExtender you can create menu entry under ‘Window’ menu

---

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [January 27, 2015, 2:45pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/7 "2015-01-27T14:45:21Z")

</div>

Nope, I still get the same effect. It works and I get a dockable tab but also the two menu items. Here’s the source code if you’d like to try by yourself [Log in with Atlassian account](https://bitbucket.org/omigamedev/ue4_plugintest)

---

<div class="post-metadata">

**Author:** ![omigamedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@omigamedev](https://forums.unrealengine.com/u/omigamedev)\
**Post date:** [January 28, 2015, 4:06pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/8 "2015-01-28T16:06:00Z")

</div>

Ok it looks like this is the solution for me, but still it does not answer to the question “why two entries are added to the menu?”

![28250-optitrack-plugin-help_solution.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/3/8c3697f76caf95c587e13a62967d2f69cecd5bc4.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e168914d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e168914d](https://forums.unrealengine.com/u/anonymous_user_e168914d)\
**Post date:** [March 13, 2018, 9:08pm UTC](https://forums.unrealengine.com/t/4-6-1-plugin-why-do-fleveleditormodule-registertabspawner-generates-two-menu-entries-for-my-tab/305134/9 "2018-03-13T21:08:20Z")

</div>

This is still an issue in 4.18.3.

Just call RegisterNomadTabSpawner and it gives you 2 entries under windows.

the FTabSpawnerEntry& returned by RegisterTabSpawner() and RegisterNomadTabSpawner() has a method called:

SetAutoGenerateMenuEntry(bool)

Which can be set to false.
