Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Re: CoreData an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1565 of 1612
Post > Topic >>

Re: CoreData and "should quit after last window closed"

by Gregory Weston <uce@[EMAIL PROTECTED] > Jan 29, 2008 at 03:52 PM

In article <7791207D-C57A-4932-8E04-DCDB577CAC41%schlueter@[EMAIL PROTECTED]
>,
 Martin Schlueter <schlueter@[EMAIL PROTECTED]
> wrote:

> Hi
> 
> I'm not an expert in programming but I managed to build a CoreData 
> application and enhanced it with some AppleScript. My app has only one 
> window and from time to time my user manages to close the window and 
> has no way of re-opening it (apart from quitting and restarting).
> 
> I see two possibilities to get around this:
> 
> 1.) 
> My app could open the window when activated again (as Mail, 
> iTunes, ... does)
> 
> 2.)
> My app could quit when the windows closes.

3. You could provide an explicit menu command for the user to invoke to 
reopen the window, as Mail and iTunes do. But that's just another way to 
invoke the underlying functionality you're talking about in point #1.

Whether the application should quit automatically or not when the last 
window closes is very app-specific and more than a little subjective. 
It's a behavior that should generally be adopted by very single-purpose 
tools that in a prior life might've been implemented as desk accessories 
for example. Something where closing the window is a very clear signal 
that the user is "done."

 
> So far I have no idea how to manage this. In the "currency converter" 
> tutorial I found the following event handler
> 
> on should quit after last window closed theObject
> 	return true
> end should quit after last window closed
> 
> I added the handler to the AppleScript and linked it with the event in 
> Interface Builder. But this doesn't work, the event handler is not 
> even called.

What object did you link it *to*? I've only done the briefest of 
dabbling with AppleScript Studio, but for Cocoa that handler will only 
be triggered if it's implemented by an object that's designated as the 
delegate for the application. It wouldn't be something that, for 
example, you associate with a window.

G




 3 Posts in Topic:
CoreData and "should quit after last window closed"
Martin Schlueter <schl  2008-01-29 17:42:04 
Re: CoreData and "should quit after last window closed"
Gregory Weston <uce@[E  2008-01-29 15:52:16 
Re: CoreData and "should quit after last window closed"
Martin Schlueter <schl  2008-02-01 16:13:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 8:39:50 CDT 2008.