Xcoding an "About" panel that slides down from the title bar

I have created a non-document application and would like to make a nicer “About Panel” than what is stock. I would like to have the About Panel connected to the main window so when it is selected, it pops down and when closed, closes. I do not want a separate window with the About info if I do not have to. What are my options here and how to do?

Thomas :?

See this thread (which could have been easily found by searching the BBS):



Jon, I did search the BBS but this did not answer my question. I understand I can make my own panel and link it to a button in the main window so when it is clicked, the panel opens, but I need help, a step-by-step, on how to make this panel I create not be a separate panel that pops up on the screen but “scrolls” from the main menus status bar and stays connected to it, like it is part of the window. When closed, it scrolls back up and gets out of the way. This is how I would like my about panel to show up. I have seen this before but need guidance on how to do. I have Apple Script Studio with XCode running on my G5 Panther system. So, can anyone tell me how to make a panel window like I want stay connected to the main window and scroll up and out of the way when I close it.



As I mentioned in that thread, you can see examples of how I attach the about panel to the main window in many of the demo AppleScript Studio projects on my site:


As to having it attached to the status bar, that’s a different beast entirely. Not quite sure how to accomplish that.


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

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

ah! This is what I was looking for. Thanks! I will give it a shot.

Thanks again!