Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing and closing windows in AppleScript Studio (Xcode 2, Tiger)



In Panther, when a user closed a window, it was not released in memory (and therefore leaked), which is why 'show window "Main"' or 'set visible of window "Main" to true' still worked after the window was closed.  In Tiger, we fixed this leak by releasing the window object when the user closes the window.  It therefore no longer exists to respond to further show commands.  

The solution for Tiger is not to close the window, but instead hide it if you want to keep it around. You can do this by adding an 'on should close' handler to your application as shown in the following example:

on choose menu item theObject
    show window "Main"
end choose menu item

on should close theObject
    hide window "Main"
    return false
end should close



John Coelho
AppleScript / Automator Engineering Team

On Apr 22, 2005, at 7:02 AM, Kristofer Szymanski wrote:


I am working with my AppleScript Studio projects in Xcode 2.0 (I am running Tiger) and notice that if I close a window in an AppleScript application there is no way to get it back... probably because the AppleScript name of the window is gone.

Here is a small project that illustrates this problem:


Please tell me if I am doing something wrong or (if not) if there is any workaround. Thanks for your help.

Kristofer


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Showing and closing windows in AppleScript Studio (Xcode 2, Tiger) (From: Kristofer Szymanski <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.