# Please Help: How can I hide the Menubar using Script

**URL:** <https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [February 11, 2021, 4:01am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281 "2021-02-11T04:01:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hd.wu](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@hd.wu](https://forum.inductiveautomation.com/u/hd.wu)\
**Post date:** [February 11, 2021, 4:01am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/1 "2021-02-11T04:01:39Z")

</div>

Hi Everyone,

I need a hand on using script to hide and show the Menubar base on the navigation ID. I don’t want to use custom menu as suggested in other [post](http://forum.inductiveautomation.com/t/script-to-show-or-hide-client-menubar/30852). Thank you.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 11, 2021, 10:45am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/2 "2021-02-11T10:45:02Z")

</div>

> [@hd.wu](#):
>
> navigation ID

I'm not sure what you mean by this? Do you mean the Dock ID?

If so, you can just use:  
`system.perspective.closeDock('dock-id') `

---

<div class="post-metadata">

**Author:** ![hd.wu](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@hd.wu](https://forum.inductiveautomation.com/u/hd.wu)\
**Post date:** [February 11, 2021, 11:05am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/3 "2021-02-11T11:05:24Z")

</div>

Hi nminchin,

I am working on Vision not Perspective. I would like to hide the follow Menubar using script. The navigation id was something I created myself to identify the pages. Thanks.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/515737098eca8b20d07576b776dadf7bb7e1a07b.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 11, 2021, 11:09am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/4 "2021-02-11T11:09:53Z")

</div>

Is that menu bar in its own dock/window?  
You can close a window with:  
`system.nav.closeWindow('window/path')`  
And then openWindow to open it again  
Is that what you’re after?

---

<div class="post-metadata">

**Author:** ![hd.wu](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@hd.wu](https://forum.inductiveautomation.com/u/hd.wu)\
**Post date:** [February 11, 2021, 11:30am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/5 "2021-02-11T11:30:24Z")

</div>

That was the buildin menubar created from client events - menubar

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 11, 2021, 11:40am UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/6 "2021-02-11T11:40:15Z")

</div>

Oh right, I’ve never used that before 😅 I’m bailing out!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 11, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/please-help-how-can-i-hide-the-menubar-using-script/43281/7 "2021-02-11T15:11:55Z")

</div>

You could adapt the following technique to set an empty JMenuBar....

> [@How to change Windows Bar at top of Example Project?](http://forum.inductiveautomation.com/t/how-to-change-windows-bar-at-top-of-example-project/2409/8):
>
> Automatic dropdown navigation menu (only adds folders one level deep): from javax.swing import SwingUtilities, JMenu, JMenuBar, JMenuItem from functools import partial window = system.nav.getWindow("somewindow") root = SwingUtilities.getRoot(window) menu = root.getJMenuBar() navmenu = JMenu("Navigation"); def handleSelect(event, target): system.nav.swapTo(target) trees = {} leaves = [] for window in system.gui.getWindowNames(): winsplit = window.split('/') if winsplit[0] != 'Nav': …

_ **Not** _ a supported thing to do. You'll have to get familiar with Java Swing's menu architecture.
