Multi Window/Panel App

Hi y’all
I’m struggling with an app I’m building.
It’s basically 3 windows, 2 children being launched from the one master window.
I want to launch them as ‘sheets’ (i.e. over the master window), but I simply can’t figure out how to get them to work. I have dismembered the Drawer and ‘Display Panel’ examples with ASS but am absolutely stumped!

Button names (AScript) in master window are:
manage_key - which should load window (AScript name = “key_manager”
engine_status - which should load window (AScript) name = “engine_controller”

I have built so many versions of this that I now don’t know whether I am coming or going! Can anyone help, or give me a few pointers?

cheers
Biz

bizk,

You will need to set up the widows that you want to open “as sheets” as panels. Panels are special windows that can be “attached” to other windows. Then, below is some working code for the on clicked handler attached to buttons in the main window of one of my projects that I have changed to reflect your object names:

on clicked theObject
	-- the window containing the button as a variable
	set theWindow to window of theObject
	-- the name of the button
	set theObjectName to name of theObject
	
	if theObjectName is "manage_key" then
		-- not attached, for demonstration
		set visible of window "key_manager" to true 
		
	else if theObjectName is "engine_status" then
		-- attached to window containing the clicked button
		display panel window "edits" attached to theWindow 
	end if

end clicked

I hope this helps you to understand. I if you have more questions or this isnt clear, dont hesitate to ask more questions.

~Ross

Thanks Ross

That was just what I needed. Perfect and mind-numbingly simple too!

Everything is now starting to work the way I wanted it to.

cheers
Biz

You are welcome, Biz. I am glad to hear everything is working. I love that feeling.

~Ross