Re: why o why won't my window display?
Re: why o why won't my window display?
- Subject: Re: why o why won't my window display?
- From: Shane Stanley <email@hidden>
- Date: Thu, 22 Nov 2012 22:48:57 +1100
On 22/11/2012, at 10:28 PM, Brian Christmas <email@hidden> wrote:
> It works, so I'll leave it alone.
I admire your pragmatism, but that's really too ugly. It helps if you understand what's happening, so ignore your applicationWillFinishLaunching_ for now.
When a handler is called and it changes the UI by adding text or whatever, the display doesn't update until the event that triggered the handler has been fully dealt with, which usually means the end of that handler. For time-consuming handlers that means nothing happens until the handler is finished.
You can get around the issue by calling displayIfNeeded() on the window whenever you want it to update. So you can probably just use:
on applicationDidFinishLaunching_(aNotification)
Progress's setUsesThreadedAnimation_(true)
set theTempMessage to "Please wait. I'm collecting all the email addresses."
Messages's setStringValue_(theTempMessage)
tell windowMain to displayIfNeeded()
my FillInClients_()
end applicationDidFinishLaunching_
And call displayIfNeeded() again as need in your other handler.
For better results, you can instead use the technique outlined in chapter 13 of my book, with a handler like doEventFetch(), or fordEvent() from ObjectwithFords.
(And as a matter of style, you should begin the name of variables and methods with a lower-case letter, reserving upper-case for class names.)
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden