G’day once more scripters.
Another question, sorry.
In Yosemite, I’ve added a second ‘Setup’ window to my app which was carried over from Mountain Lion.
The new window works fine if I start up with it showing, but the original window does not work. It’s always greyed out, and is transparent to mouse clicks. Clicking on it either activates the Finder, or if double clicked over a folder, opens the folder. Nothing I have done so far alters this strange behaviour.
Before I go the the extreme measure of rebuilding the whole Interface, I’m wondering if there’s a remedy anyone knows of, or if this is a common problem?
Should I file a bug report, also?
As well, I’m trying to set the position of the setup window relative to the main window, without success.
However, this might be due to the fact the main window is not working. Anyone care to comment if my code is correct, please?
Regards
Santa
Code I’m using to toggle windows…
on toggleWindows:sender tell me to activate if my displayMainMailManagerWindow then say "Displaying Setup window" as text try tell windowMainMM to display() end try try tell application "System Events" to tell process "Mail Manager" try set the props to get the properties of the front window —< Doesn’t work set oldOrigin to position of props say 2 set newX to (oldOrigin's x) - 226 #as integer say 3 set newY to oldOrigin's y #as integer say 4 windowSetUpMM's setFrameOrigin:{newX as integer, newY as integer} on error errmsg number errNum if errNum ≠ -1719 then display dialog "toggleWindows " & errmsg & " number " & errNum end try say 5 end tell end try set my displayMainMailManagerWindow to false say 6 my makeKeyWindow() say 7 else say "displaying main window" as text try tell windowSetUpMM to display() end try set my displayMainMailManagerWindow to true say 9 my makeKeyWindow() say 10 end if end toggleWindows:
on makeKeyWindow() try if my displayMainMailManagerWindow then windowMainMM's makeKeyAndOrderFront:self() try tell windowMainMM to display() end try else windowSetUpMM's makeKeyAndOrderFront:self() try tell windowSetUpMM to display() end try end if on error errmsg display dialog "makeKeyWindow " & errmsg end try end makeKeyWindow
|