window and panel open at the same time ?

Hello all,

I have a window and a hidden panel. I have a button which displays the panel when clicked, only when that panel is open, the window is unaccessible.

Is there a workaround ? I’ve looked online but still cant find the right configuration (i’m sure its something stupid like ticking a box in IB !)

thanks in advance…

How is it unaccessible? Not sure what you mean. What code are you using that doesn’t work?

Hello,

Oh the code works fine! It compiles no problem !
Well first, to be more precise, the window is the main window.
The panel doesn’t show on launch, I only want it to appear when a button is clicked. The panel only shows a list of selected files from the main window.
But I would like to be able to them both open at the same time, which doesnt work at the moment.

By “unaccessible” I mean that as long as the panel is open, I cannot use the window (it stays in the back) and when I click on the window I hear an error sound. Does that make sense?

Here is the code I have, nothing special :

on clicked theObject
	if (name of theObject is "openPanel") then
		display panel window "fileListPanel"
	else if (name of theObject is "closePanel") then
		close panel window 1
	end if
End clicked

The closePanel button is on the panel itself because if I close it by clicking the red close button (on the bar) then it disappears, but I cant use the main window !

Thanks for anyhelp you can give me.

I see the problem. You are showing and hiding the panel wrong. When you use “display” it is like you are displaying a dialog box and thus the application pauses and waits for the dialog to be dismissed. It’s just like display dialog in applescript.

To show a window/panel use the word “show”… that makes it visible

show panel "fileListPanel"

To hide a panel or a window use this…

set visible of panel "fileListPanel" to false

Note: Panels can be strange some times meaning that sometimes you have to call them a window instead of a panel. So use “panel” first and if that doesn’t work then try “window”.

Awesome !

I guess I tried the wrong code … I tried “open panel window” instead of “display” but it wouldn’t compile so I was confused !

Thanks a lot my friend :slight_smile:

PS : just tried compiling with that, and works perfectly :smiley: