EDIT >> I posted near the same time jonn8 did, and did not see his message until I submitted. I was under the impression that you were confusing the title bar for the ‘status bar’. If so then this message applies. Otherwise, if you want it to come down off the bottom of the window, i.e. where the “status bar” would be, say, in a web browser, then you’ll have to use a drawer displayed off the bottom of the window. That’s another story. << END EDIT
Here’s what I use…
Create your About Panel as an actual “Panel” (dragged from the object palettes in IB), not as a window. Set the panel’s applescript name to whatever you want…I used “AboutPanel” for the example code below. You can set the size of the window to exactly that of the main window so it will cover it entirely, so it slides in and seems to “replace” the main window.
Connect your button or menu item to the script using an ‘on clicked’ or ‘on choose menu item’ event, as is appropriate. If you’re using the default “About MY_APP” menu item in the application menu, make sure to go into “Connections” in IB and disconnect the default connection. Set the applescript name of the menu item to whatever you’d like…I used “LaunchAboutPanel”.
Add this to the top of your script…
property currentPanel : missing value -- no default panel
…then…
Assuming you’re linking to the about “myapp” menu item in the application menu, and that the window you want the panel attached to is named “MainWindow”, add the following to your code…
on choose menu item theObject
if (name of theObject is equal to "LaunchAboutPanel") then
if not (exists currentPanel) then
set currentPanel to window "AboutPanel"
end if
display panel currentPanel attached to window "MainWindow"
set currentPanel to ""
end choose menu item
You can use this same code attached to a button named “LaunchAboutPanel” in your on clicked handler.
To close the panel use…
on clicked theObject
if (name of theObject is equal to "ClosePanel") then -- Close any open panel
close panel (window of theObject)
set currentPanel to ""
end if
This code closes whatever panel the button is in, so to close any panel put a button in it named “ClosePanel” and point it at the script.
Hope this helps
j