# Sliding side bar

**URL:** <https://forum.inductiveautomation.com/t/sliding-side-bar/7664>\
**Category:** Ignition\
**Created:** [December 4, 2013, 7:48am UTC](https://forum.inductiveautomation.com/t/sliding-side-bar/7664 "2013-12-04T07:48:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyP](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@AndyP](https://forum.inductiveautomation.com/u/AndyP)\
**Post date:** [December 4, 2013, 7:48am UTC](https://forum.inductiveautomation.com/t/sliding-side-bar/7664/1 "2013-12-04T07:48:12Z")

</div>

Has anyone tried this? Is it possible in Ignition? I’d like a sidebar with a tree structure on the left; the user should have the ability to hide this when they prefer to look at an uncluttered screen, so the left nav should be able to slide in and out from the left hand side.

Thanks

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [December 4, 2013, 2:07pm UTC](https://forum.inductiveautomation.com/t/sliding-side-bar/7664/2 "2013-12-04T14:07:04Z")

</div>

to slide the sidebar put this script on a components event handler script under mouse dragged. on ours we just have a small strip with some dots on the right edge of the sidebar screen, similar to what you would find in most applications for resizing a window. The user would then click on and drag on that strip to resize the window.

```auto
from java.awt import Dimension
window = system.gui.getParentWindow(event)
parent = window.parent
manager = parent.getDesktopManager()
d = window.getSize()
newWidth = window.width + event.x
if newWidth > 250:
	manager.resizeFrame(window, 0, 0, newWidth, d.height)
	manager.layoutDocks()
```

to show/hide the sidebar, put this script on a button’s mouse released event. this button has to be on a separate screen than the sidebar, obviously.:

```auto
try:
	window = system.gui.getWindow("Sidebar")
	system.nav.closeWindow(window)
	event.source.text = "Show Sidebar"
except:
	system.nav.openWindow("Sidebar")
	event.source.text = "Hide Sidebar"
```

---

<div class="post-metadata">

**Author:** ![AndyP](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@AndyP](https://forum.inductiveautomation.com/u/AndyP)\
**Post date:** [December 8, 2013, 3:50pm UTC](https://forum.inductiveautomation.com/t/sliding-side-bar/7664/3 "2013-12-08T15:50:31Z")

</div>

Thanks! Been swamped with work so haven’t had a chance to get back to this, but I’ll give it a go later.
