Sliding side bar

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.


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.

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)

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.:

	window = system.gui.getWindow("Sidebar")
	event.source.text = "Show Sidebar"
	event.source.text = "Hide Sidebar"

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